Will a destructor destroy a static member?
Posted
by Jeremy Simon
on Stack Overflow
See other posts from Stack Overflow
or by Jeremy Simon
Published on 2010-05-24T02:22:29Z
Indexed on
2010/05/24
2:31 UTC
Read the original article
Hit count: 300
c++
Say I have:
class A
{
A()
{}
~A()
{}
};
class B
{
public:
B()
{}
~B()
{}
private:
static A mA;
};
B* pB = new B;
delete pB;
When I call delete pB, B's destructor will be called. Will this then call the destructor for static member A?
© Stack Overflow or respective owner