Class Notebook
{
int n;
void bcd()
Notebook n;
// ..Insert code that should execute when n is still in it's scope..
we want the side-effect of n's destructor here!
// ..Insert code that should execute after n is destroyed..
}
On calling a destructor explicitly, an undefined behavior is occurred, because the destructor may invoke twice for the local variable. Firstly, on explicit calling and secondly automatic calling when the local variable destroys. Therefore, a destructor cannot be called explicitly if needed.