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.
Leave a Reply