
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.49 KB | hits: 22 | expires: Never
Errors in std::make_shared() when trying to make shared_ptr?
class Foobar {
public:
Foobar(Baz* rBaz);
private:
Foobar();
}
Baz* myBaz = new Baz();
std::shared_ptr<Foobar> sharedFoo = std::make_shared<Foobar>(new Foobar(myBaz));
error C2664: 'Foobar::Foobar(const Foobar &)' : cannot convert parameter 1 from 'Foobar *' to 'const Foobar &'
3> Reason: cannot convert from 'Foobar *' to 'const Foobar'
std::shared_ptr<Foobar> sharedFoo = std::make_shared<Foobar>(myBaz);