#include<iostream>
using namespace std;
class A {
public:
int i;
};
int main() {
const A aa; //This is wrong, I can't compile it! The implicitly-defined constructor does not initialize ‘int A::i’
}
当我使用
class A {
public:
A() {}
int i;
};
还行吧!我可以编译它!为什么我使用隐式定义的构造函数时无法编译它?