|
-
May 4th, 2010, 12:51 PM
#19
Re: Constructor Inheritance
Been playing with virtual copy assignment operators. Although in Base properties recognizes the operator as having the 'IsVirtual' property true, I cant find any signature in Derived that doesn't include the virtual keyword for which the same property is true. This is making it look like copy assignment is not inherited and virtual is all but ignored. How should a virtual copy assignment operator behave? It really doesn't make any sense to me.
As for virtual destructors as LL pointed out, the slot in the vtable is inherited but the destructor itself isn't. The base class destructor will be called implicitly by the compiler so it has to be accessible to the derived class but at no time does Base::~Base become a member of Derived. The standard allows explicitly calling destructors( basically only for placement new use) but does not allow the same latitude with constructors.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|