#include <memory>
std::shared_ptr<int> factory(int arg)
{
return std::make_shared<int>(arg);
}
std::shared_ptr<int> use_factory(int arg)
{
auto p = factory(arg);
return p;
}
int main(int argc, char *argv[])
{
use_factory(14);
}
I2luY2x1ZGUgPG1lbW9yeT4KCgpzdGQ6OnNoYXJlZF9wdHI8aW50PiBmYWN0b3J5KGludCBhcmcpCnsKCXJldHVybiBzdGQ6Om1ha2Vfc2hhcmVkPGludD4oYXJnKTsKfQoKc3RkOjpzaGFyZWRfcHRyPGludD4gdXNlX2ZhY3RvcnkoaW50IGFyZykKewoJYXV0byBwID0gZmFjdG9yeShhcmcpOwoJcmV0dXJuIHA7Cn0KCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKCXVzZV9mYWN0b3J5KDE0KTsKfQ==