#include <memory>
struct A;
struct B {
typedef std::shared_ptr<B> Ptr;
};
struct A {
operator B::Ptr() {
return std::make_shared<B>();
}
};
int main() {
A* a = new A;
B::Ptr{*a};
}
I2luY2x1ZGUgPG1lbW9yeT4KCnN0cnVjdCBBOwoKc3RydWN0IEIgewogIHR5cGVkZWYgc3RkOjpzaGFyZWRfcHRyPEI+IFB0cjsKfTsKCnN0cnVjdCBBIHsKICBvcGVyYXRvciBCOjpQdHIoKSB7CiAgICByZXR1cm4gc3RkOjptYWtlX3NoYXJlZDxCPigpOwogIH0KfTsKCmludCBtYWluKCkgewogIEEqIGEgPSBuZXcgQTsKICBCOjpQdHJ7KmF9Owp9