成员变量和基类的析构顺序,能换转吗?该如何解决

成员变量和基类的析构顺序,能换转吗?
C++默认是先析构成员变量,再析构基类的。

但我希望,某些类,可以指定析构顺序,先析构基类,再析构成员变量。

求大神啊。



------解决方案--------------------
把组合/聚合改称私有继承.
#include <iostream>

struct Widget
{
void foo()
{
std::cout << __FUNCTION__ << std::endl;
}
~Widget()
{
std::cout << __FUNCTION__ << std::endl;
}
};

struct ContainerBase
{

~ContainerBase()
{
std::cout << __FUNCTION__ << std::endl;
}
};

#if 1
struct Container: public ContainerBase
{
void foo()
{
m_w.foo();
}

~Container()
{
}
Widget m_w;
};

#else
struct Container : private Widget,public ContainerBase
{
void foo()
{
Widget::foo();
}
~Container()
{
}
};

#endif

int main()
{
Container c;
c.foo();
return 0;
}