Why does the destructor of the class called twice ?
- by dicaprio
Apologies if the question sounds silly, I was following experts in SO and trying some examples myself, and this is one of them. I did try the search option but didn't find an answer for this kind.
class A
{
public:
A(){cout t;
t.push_back(A()); // After this line , when the scope of the object is lost.
}
Why does the destructor of the class called twice ?