I have a Microsoft C++ 11 application.
I have a vector of shared_ptrs that get returned from a method call.
In order for that vector not to be leaked, I have wrapped it in a shared_ptr as well.
How do I iterate over that vector when it is wrapped in a smart (shared) pointer?
// Definition of the method
// Now in another method....
shared_ptr<vector<shared_ptr<Foo>>> values = GetVectorOfValues();
for (auto value : values.get())
I would have thought that "get()" would get me to the wrapped vector.
How would I go about doing this?
Is there a better pattern to use to achieve my goals?