Re: interface programming
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Tue, 4 Apr 2006 18:06:30 +0100
It's not at all academic.
You are right. I was thinking that the presence of virtual member functions
(pure or not) meant that the compiler would implicitly generate a virtual
destructor. But the standard is silent on that point in 12.4.
Only if the class is derived from a base class which has a virtual
destructor does the standard speak up and mandate that any derived class's
implicitly generated destructor must be virtual.
Stephen Howe
.
Relevant Pages
- Re: Virtual destructors are unique virtuals right
... The destructor of a derived class does not call the ... >> of its base class, regardless of whether the base class has a virtual ... constructor for the BaseClass, then calls the constructor for the ... DerivedClass. ... (comp.lang.cpp) - Re: Odd behavior, vector member, MFC and consol app
... someone call the base class destructor which then ended up doing something bad. ... it should have no virtual functions at all. ... A good clue that a class is not intended for derivation is the absence ... (microsoft.public.vc.mfc) - Re: Cant compile this code *****SOLVED****
... your real program might contain hundreds of code sequences ... that the base class implements a 'virtual' ... destructor, so that when de-allocating objects created via ... (alt.comp.lang.learn.c-cpp) - Re: inhibit compiler warning C4624 for a class hierarchy
... Any class must have a destructor before you can ... create (or, to be exact, destroy) an instance of it. ... implicitly-declared destructor, ... a base class with an inaccessible destructor. ... (microsoft.public.vc.language) - Re: My final shape program, what do you think?
... >> pointer to its base class then the base class must have a virtual ... >> destructor or its undefined behaviour. ... > i should have to use a virtual deconstructor if i want dervive ... (comp.lang.cpp) |
|