#include #include namespace smart_ptr { struct C { int value; }; struct D { boost::shared_ptr Get() { return ptr; } void Set( boost::shared_ptr c ) { ptr = c; } private: boost::shared_ptr ptr; }; std::auto_ptr New() { return std::auto_ptr( new D() ); } }