Below errors out. Understood.
class a {
int b;
int &c; // uninitialized
a(int x): b(x) {}
};
Below uses synthesized constructor. Why no error below? How does the synthesized constructor initialize the reference or will it even do that? Reference has to be user initialized from what I understand.
class a {
int b;
int &c;
};
Aucun commentaire:
Enregistrer un commentaire