#include <cstdio>
template<class T0> struct prop {
T0 operator()() {
return data;
}
void operator()( T0 data_ ) {
data = static_cast<T0&&>( data_ ); //data_ is always a copy, so move it
}
T0 data;
};
struct test {
prop<int> data;
};
int main() {
test t0{};
t0.data( 10 );
printf( "data = %d\n", t0.data() );
}
I2luY2x1ZGUgPGNzdGRpbz4KCnRlbXBsYXRlPGNsYXNzIFQwPiBzdHJ1Y3QgcHJvcCB7CgogICAgVDAgb3BlcmF0b3IoKSgpIHsKICAgICAgcmV0dXJuIGRhdGE7CiAgICB9CgogICAgdm9pZCBvcGVyYXRvcigpKCBUMCBkYXRhXyApIHsKICAgICAgZGF0YSA9IHN0YXRpY19jYXN0PFQwJiY+KCBkYXRhXyApOyAvL2RhdGFfIGlzIGFsd2F5cyBhIGNvcHksIHNvIG1vdmUgaXQKICAgIH0KCiAgICBUMCBkYXRhOwp9OwoKc3RydWN0IHRlc3QgewogICAgcHJvcDxpbnQ+IGRhdGE7Cn07CgppbnQgbWFpbigpIHsKCiAgdGVzdCB0MHt9OwoKICB0MC5kYXRhKCAxMCApOwogIAogIHByaW50ZiggImRhdGEgPSAlZFxuIiwgdDAuZGF0YSgpICk7CiAgCn0K