参考这个页面
https://www.jianshu.com/p/0e7939d792d1
在一个结构体内写了构造函数后
从:
struct aa
{
int a;
int b;
}
修改为:
struct aa
{
int a;
int b;
aa()
{
a = 0;
b = 0;
}
}
后
再用
struct aa test1;
memset(&test1,0,sizeof(struct aa));
kw就会报错,在一个non-pod对象上使用了memset