I have a MS C++ (unmanaged) application and am new to smart pointer usage.
We've decided to go with the smart pointer implementation that is part of C++ 11.
I haven't really used smart pointers very much. I've checked out the wiki definition and
have a basic idea.
I have a question regarding returning smart pointers from a function/method call.
Consider the following example using raw pointers:
What would the best approach be for converting this to using smart pointers, to use a shared pointer?
FOO * CreateFooObject()
FOO * foo = new FOO();
I thought that this would be the appropriate pattern, but I wanted to confirm.
shared_ptr<FOO> foo = make_shared<FOO>();