Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
Advertisement
Add Comment
Please, Sign In to add comment