#include <iostream>
class A {
public:
A(int i) : i_(i){
std::cout << "A() is constructed (this = " << static_cast<void*>(this) << ")\n";
}
~A() {
std::cout << "A() is destructed (this = " << static_cast<void*>(this) << ")\n";
}
void hello() {
std::cout << "Hello from A! (this = " << static_cast<void*>(this) << ")\n";
}
private:
int i_;
};
void hello(A& a) {
return a.hello();
}
int main() {
A a((hello(a),42));
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogCmNsYXNzIEEgewogcHVibGljOgogICBBKGludCBpKSA6IGlfKGkpewogICAJc3RkOjpjb3V0IDw8ICJBKCkgaXMgY29uc3RydWN0ZWQgKHRoaXMgPSAiIDw8IHN0YXRpY19jYXN0PHZvaWQqPih0aGlzKSA8PCAiKVxuIjsKICAgfQogICB+QSgpIHsKICAgCXN0ZDo6Y291dCA8PCAiQSgpIGlzIGRlc3RydWN0ZWQgKHRoaXMgPSAiIDw8IHN0YXRpY19jYXN0PHZvaWQqPih0aGlzKSA8PCAiKVxuIjsKICAgfQogICB2b2lkIGhlbGxvKCkgewogICAJc3RkOjpjb3V0IDw8ICJIZWxsbyBmcm9tIEEhICh0aGlzID0gIiA8PCBzdGF0aWNfY2FzdDx2b2lkKj4odGhpcykgPDwgIilcbiI7CiAgIH0KIHByaXZhdGU6CiAgaW50IGlfOwp9OwoKdm9pZCBoZWxsbyhBJiBhKSB7CiAgcmV0dXJuIGEuaGVsbG8oKTsKfQoKaW50IG1haW4oKSB7CglBIGEoKGhlbGxvKGEpLDQyKSk7Cn0=