- 论坛徽章:
- 0
|
大体代码如下:
//.h
class CA
{
public:
CA();
}
class CMytest
{
public:
static CMytest* singleton(VOID)
{
if (_pSingleton == NULL)
_pSingleton = new CMytest();
return _pSingleton;
}
private:
CMytest(VOID);
~CMytest(VOID);
private:
static CMytest* _pSingleton;
std::map<BYTE, CA*> _testCA;
};
//.c
CMytest* CMytest::_pSingleton = NULL;
CMytest::CMytest(VOID)
{
_testCA = std::map<BYTE, CA*>();
}
使用pclint检查,对这个构造函数,有如下提示,如何消除?谢谢
Note 1926: Symbol
'CMytest::_testCA's default constructor implicitly called -- Effective C++ #12 |
|