If I initialize member variable a
, can I immediately read the value of a
to initialize b
?
Is this guaranteed by C++(11) specifications to work always with all compilers?
Is there any side effect?
E.g:
class X {
public:
int a;
int b;
X() : a(1), b(a+1) {}
};
Aucun commentaire:
Enregistrer un commentaire