标签:blog ar for div on log amp ef c++
class Base { public: Base() { cout << "cons" << endl; } ~Base() { cout << "de" << endl; } static Base* Default() { static Base b; return &b; } }; int main(int argc, char** argv) { for (int i = 0; i < 3; i++) { Base::Default(); } }
只构造析构一次!
标签:blog ar for div on log amp ef c++
原文地址:http://www.cnblogs.com/lucasysfeng/p/4049495.html