#include <iostream>
using namespace std;
class foo
{
private int m_var;
void setVar(int a_var)
{
// do something before setting value, like emitting signal
m_var = a_var;
}
void method()
{
int copy = m_var; // ok
m_var = 5; // error!
setVar(101); // ok
}
};
int main() {
// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgZm9vCnsKICAgIHByaXZhdGUgaW50IG1fdmFyOwogICAgdm9pZCBzZXRWYXIoaW50IGFfdmFyKQogICAgewogICAgICAgIC8vIGRvIHNvbWV0aGluZyBiZWZvcmUgc2V0dGluZyB2YWx1ZSwgbGlrZSBlbWl0dGluZyBzaWduYWwKICAgICAgICBtX3ZhciA9IGFfdmFyOwogICAgfQogICAgdm9pZCBtZXRob2QoKQogICAgewogICAgICAgIGludCBjb3B5ID0gbV92YXI7IC8vIG9rCiAgICAgICAgbV92YXIgPSA1OyAvLyBlcnJvciEKICAgICAgICBzZXRWYXIoMTAxKTsgLy8gb2sKICAgIH0KfTsKCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJcmV0dXJuIDA7Cn0=