class NoStackObject { protected: NoStackObject() { } ~NoStackObject() { } public: static NoStackObject* creatInstance() { return new NoStackObject() ;//调用保护的构造函数 } void destroy() { delete this ;//调用保护的析构函数 } }; |
class NoStackObject { protected: NoStackObject() { } ~NoStackObject() { } public: static NoStackObject* creatInstance() { return new NoStackObject() ;//调用保护的构造函数 } void destroy() { delete this ;//调用保护的析构函数 } }; |