#include <iostream>
class foo
{
public:
foo() { }
foo(std::string secret) : secret(secret) { }
void steal_secret(const foo& other) { secret = other.secret; }
std::string get_secret() { return secret; }
private:
std::string secret;
};
int main() {
foo f1("don't tell anybody this...");
foo f2;
f2.steal_secret(f1);
std::cout << f2.get_secret() << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgZm9vCnsKICBwdWJsaWM6CiAgICBmb28oKSB7IH0KICAgIGZvbyhzdGQ6OnN0cmluZyBzZWNyZXQpIDogc2VjcmV0KHNlY3JldCkgeyB9CiAgICB2b2lkIHN0ZWFsX3NlY3JldChjb25zdCBmb28mIG90aGVyKSB7IHNlY3JldCA9IG90aGVyLnNlY3JldDsgfQogICAgc3RkOjpzdHJpbmcgZ2V0X3NlY3JldCgpIHsgcmV0dXJuIHNlY3JldDsgfQogIHByaXZhdGU6CiAgICBzdGQ6OnN0cmluZyBzZWNyZXQ7Cn07CgppbnQgbWFpbigpIHsKICAgIGZvbyBmMSgiZG9uJ3QgdGVsbCBhbnlib2R5IHRoaXMuLi4iKTsKICAgIGZvbyBmMjsKICAgIGYyLnN0ZWFsX3NlY3JldChmMSk7CiAgICBzdGQ6OmNvdXQgPDwgZjIuZ2V0X3NlY3JldCgpIDw8IHN0ZDo6ZW5kbDsKICAgIHJldHVybiAwOwp9