I have this code that doesn\'t work, but I think the intent is clear:
testmakeshared.cpp
#include class A { public: stat
You can use this:
class CVal { friend std::shared_ptr; friend std::_Ref_count; public: static shared_ptr create() { shared_ptr ret_sCVal(new CVal()); return ret_sCVal; } protected: CVal() {}; ~CVal() {}; };