#include <iostream>
#include <memory>
using namespace std;
struct S
{
S() { cout << "ctor\n"; }
~S() { cout << "dtor\n"; }
void Foo() { cout << "Foo\n"; }
};
std::unique_ptr<S> gS;
int main() {
cout << "main\n";
std::move(gS)->Foo();
cout << "end main\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWVtb3J5Pgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IFMKewoJUygpIHsgY291dCA8PCAiY3RvclxuIjsgfQoJflMoKSB7IGNvdXQgPDwgImR0b3JcbiI7IH0KCXZvaWQgRm9vKCkgeyBjb3V0IDw8ICJGb29cbiI7IH0KfTsKCnN0ZDo6dW5pcXVlX3B0cjxTPiBnUzsKCmludCBtYWluKCkgewoJY291dCA8PCAibWFpblxuIjsKCXN0ZDo6bW92ZShnUyktPkZvbygpOwoJY291dCA8PCAiZW5kIG1haW5cbiI7CglyZXR1cm4gMDsKfQ==