Hi.

Please tell me what will be the correct output for this code:

class A {
public:
int & _i;
A();
void foo() const;
};
A::A(int& i) : _i(i) { ... }
void A::foo() const {
_i++;
}



With this main:


int main() {
int i = 5;
const A a (i);
std::cout << a._i << std::endl;
a.foo();
std::cout << a._i << std::endl;
}

Can _i be changed? Isn't it the meaning of const func - that
all class' members can't be changed by it ?