R
rajesh kalra
do the virtual mechanism works when virtual functions are called in
constructors?
constructors?
rajesh said:do the virtual mechanism works when virtual functions are called in
constructors?
rajesh said:do the virtual mechanism works when virtual functions are called in
constructors?
Barry said:
Ian said:Yes, but take care if you do!
Juha said:Do Java and C# call the derived implementations of virtual functions
even though the derived part has yet not been constructed (its
constructor has not been called yet)?
Do Java and C# call the derived implementations of virtual
functions even though the derived part has yet not been
constructed (its constructor has not been called yet)?
Curiously, it's even possible to call base class functions *before*
the base class part of the object has been constructed at all, using a
small trick (which even more curiously is legal C++, although of course
extremely not recommended).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.