Wednesday 22 February 2012

Can you explicitly call a destructor on a local variable? | Constructor in C++

No, the destructor is called when the block closes in which the local variable was created.
If a destructor is called explicitly twice on the same object, the result ends in an undefined behavior because the local variable gets destroyed when the scope ends.