We know that destructors are called automatically when the (non static) objects runs out of the declaration scope. But what if we invoke destructor explicitly?
So I have this code:
class A
{
public:
A(){std::cout<<"A's ctor"<<std::endl;}
~A(){std::cout<<"A's dtor"<<std::endl;}
};
int main()
{
A a;
a.~A();
}
And it outputs:
A's ctor
A's dtor
A's dtor
Does this mean that the object is destructed twice?