Errors in std::make_shared() when trying to make shared_ptr?
问题 (Using Visual Studio 2010) I'm trying to create a shared_ptr of an existing class in my project (class was written a decade before std::shared_ptr existed). This class takes a non-const pointer to another object, it's empty parameter constructor is private. class Foobar { public: Foobar(Baz* rBaz); private: Foobar(); } When I try to create a shared_ptr to it, things don't go well: Baz* myBaz = new Baz(); std::shared_ptr<Foobar> sharedFoo = std::make_shared<Foobar>(new Foobar(myBaz)); On