
经典的单例类
static CA* Instance(){static CA *instance =new CA() ; return instance;}
模板函数成员
template <typename T>
void creatDB(const std::vector <T> &log);
编译能过,单例的 Instance()也有值,运行到了 creatDB,this 就变成 0x0 了,然后就崩了。
1 wutiantong 2020-11-18 11:17:37 +08:00 能用,找别的原因吧 |
2 newmlp 2020-11-18 14:21:20 +08:00 这和单不单例有啥关系,肯定是其他原因 |