成员变量析构:对象会主动调用析构函数
#include <iostream> #include <list> class destructor_test{ public: ~destructor_test(){ std::cout << "~destructor_test" << std::endl; } }; class test{ private: destructor_test destructor_test_instance; }; int main () { test * test_instance = new test(); delete test_instance; return 0; }
MySQL限时解答,24小时内友哥专业解答
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指