Welcome to MSDN Blogs Sign in | Join | Help

September 2009 - Posts

C++: Calling a virtual function from a constructor is not polymorphic

In C++, if you call a virtual function form a constructor, it won’t be polymorphic, meaning that the following code won’t behave as you may have expected: class   Foo   { public :     Foo()   {        
Posted by mohamedg | 1 Comments
Filed under: ,
 
Page view tracker