#include <iostream>
#include <memory>
using namespace std;
weak_ptr<int> test() {
shared_ptr<int> foo{new int};
return foo;
}
int main() {
auto foo = test();
cout << foo.expired() << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWVtb3J5PgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCndlYWtfcHRyPGludD4gdGVzdCgpIHsKCXNoYXJlZF9wdHI8aW50PiBmb297bmV3IGludH07CgkKCXJldHVybiBmb287Cn0KCmludCBtYWluKCkgewoJYXV0byBmb28gPSB0ZXN0KCk7CgkKCWNvdXQgPDwgZm9vLmV4cGlyZWQoKSA8PCBlbmRsOwoJcmV0dXJuIDA7Cn0=