The problem is that for a certain family of classes, what if I wanted to add some functionality in their constructor/destructor. We can simply do this by updating the constructor/destructor of the Base class (if the way I wanted it to work works).
Base::~Base(){ doThisStuff(); releaseResources(); doThatStuff();}
This would imply that the derived classes don't have to know that there's been some added functionality in their constructor/destructor. Classes are a great tool to manage code and to reduce the root of all evil, redundant code. But it seems it's not working the way I wanted it this time (it works in Java).
One workaround is to explicitly invoke the initialization/get-ready-to-be-destroyed code (remove the code in constructor/destructor):
Base* anObject = new AClassInTheFamily();anObject->loadResources();// do stuffanObject->releaseResources();
This way, the functions in derived classes gets invoked. But obviously enough, this introduces some problems. That is you are obligated to call loadResources() and releaseResources() somewhere in your program which is an awkward thing to do. It also becomes a problem when there are errors in between these two calls. You may never get to call releaseResources(). And, you may also forget calling releaseResources().
If you have other suggestions, please post them.