Calling virtual functions from a constructor

24 March, 2009 § Leave a comment

Is it possible to call virtual functions from a constructor? No, you’ve got to be careful. Since objects are created from the bottom-up, they start at the base class and then move to the derived. You can find this question and many more interesting ones like it in Bjarne Stroustrup’s C++ FAQ. I got to the page when trying to explain to someone why to use a static_cast instead of a c-style cast.

Tagged: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Calling virtual functions from a constructor at JAWS.

meta