#include <iostream>
struct A {
int n;
A(int i): n(i+1) {
std::cout << "value init" << std::endl;
}
A(const A& rhs): n(rhs.n) {
std::cout << "const copy init" << std::endl;
}
A(A& rhs): n(rhs.n) {
std::cout << "copy init" << std::endl;
}
operator int() const { return n; }
};
int main()
{
A x(0);
A y=x;
A z(x);
std::cout << x.n << std::endl;
std::cout << y.n << std::endl;
std::cout << z.n << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IEEgewppbnQgbjsKQShpbnQgaSk6IG4oaSsxKSB7CnN0ZDo6Y291dCA8PCAidmFsdWUgaW5pdCIgPDwgc3RkOjplbmRsOwp9CkEoY29uc3QgQSYgcmhzKTogbihyaHMubikgewpzdGQ6OmNvdXQgPDwgImNvbnN0IGNvcHkgaW5pdCIgPDwgc3RkOjplbmRsOwp9CkEoQSYgcmhzKTogbihyaHMubikgewpzdGQ6OmNvdXQgPDwgImNvcHkgaW5pdCIgPDwgc3RkOjplbmRsOwp9Cm9wZXJhdG9yIGludCgpIGNvbnN0IHsgcmV0dXJuIG47IH0KfTsKCmludCBtYWluKCkKewpBIHgoMCk7CkEgeT14OwpBIHooeCk7CnN0ZDo6Y291dCA8PCB4Lm4gPDwgc3RkOjplbmRsOwpzdGQ6OmNvdXQgPDwgeS5uIDw8IHN0ZDo6ZW5kbDsKc3RkOjpjb3V0IDw8IHoubiA8PCBzdGQ6OmVuZGw7Cn0=