visual studio 2010 - Implicit default constructor not generated VS2010 -
i'm getting linker error in vs2010 sp1 compiling , linking code below, saying cannot find symbol base::base(void).
seems implicit default constructor not generated.
if choose initialize b follows const base& b = *d;
, works fine. if make d derived*
works. if make dosomething
not pure virtual virtual, works.
is bug or doing wrong ? tried compiling code online here http://www.compileonline.com/compile_cpp11_online.php , works fine.
struct base { virtual void dosomething() const = 0; }; struct derived : base { virtual void dosomething() const override { } }; int main() { base* d = new derived(); const auto& b = *d; return 0; }
thank you
the code fine wrt base
, nothing prevent ctor being generated. looks bug in vs2010
Comments
Post a Comment