C++ implementations (virtual methods in constructor OK?)

topic posted Mon, March 15, 2004 - 9:34 AM by  offlineGenghis "Doh!"
Share/Save/Bookmark
Advertisement
A couple years ago, a friend of mine who's a fellow C++ geek mentioned that virtual methods should not be invoked from a constructor because it's unknown whether a given C++ implementation initializes a class's virtual table before or after its constructor is invoked.

This isn't an issue with the C++ version I've worked with (Microsoft's Visual Studio C++) but I'm wondering whether anyone here has run into an implementation where it IS an issue. I haven't checked g++ yet...

Best, Don
Advertisement
Advertisement