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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -