No! [For context, please read
the previous FAQ].
Suppose the (desirable) side effect of destructing a local File object is to
close the File. Now suppose you have an object f of a class File and you
want File f to be closed before the end of the scope (i.e., the }) of the
scope of object f:
void someCode()
{
File f;
...code that should execute when f is still open...
← We want the side-effect of f's destructor here!
...code that should execute after f is closed...
}
There is a
simple solution to this
problem. But in the mean time,
remember:
Do not explicitly call the
destructor!