C++11 make_shared instancing
Apologies for the long question, but some context is necessary. I have a bit of code that seems to be a useful pattern for the project I'm working on: class Foo { public: Foo( int bar = 1 ); ~Foo(); typedef std::shared_ptr< Foo > pointer_type; static pointer_type make( int bar = 1 ) { return std::make_shared< Foo >( bar ); } ... } As you can see, it provides a straightforward way of constructing any class as a PointerType which encapsulates a shared_ptr to that type: auto oneFoo = Foo::make( 2 ); And therefore you get the advantages of shared_ptr without putting references to make_shared and