private: A* instance = 0; public: A* CreateInstance(){ //构造 if(!instance) //还没有生成实例,创建之,否则不加理会 instance = new A; return instance; } protected: A();