C++单例模式与多线程安全

用代码实现以下:web class Singleton { public: static Singleton* CreateObj() { if (m_pInstance == NULL) { m_pInstance = new Singleton(); } return m_pInstance; } void test() { cout << "访问单例类的接口。"
相关文章
相关标签/搜索