C++ FAQ Celebrating Twenty-One Years of the C++ FAQ!!!
(Click here for a personal note from Marshall Cline.)
Section 11:
[11.6] What if I want a local to "die" before the close } of the scope in which it was created? Can I call a destructor on a local if I really want to?

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!