How to make a std::shared_ptr from a non-pointer object?

Viewed 2406

As output from one function, I get an object of type Foo. As an argument to another class, I need to pass an object of type std::shared_ptr<Foo>. How can I make the shared pointer from the original object?

5 Answers
Related