c++11中線程安全單例模式( Meyers Singleton)

class Singleton { public: static Singleton& Instance() { static Singleton theSingleton; return theSingleton; } /* more (non-static) functions here */ private: Singleton(); // ctor hidden Singleton
相關文章
相關標籤/搜索