i have a quick question about having a reference to a subset of a collection. Consider i have a vector of objects. Now I want to create another vector which is a subset of this vector, and I dont want to create a copy of the subset of objects.
One of the ways I was thinking about is creating a vector<auto_ptr<MyClass> >
. Is this a good approach?
Please suggest if you think any other containers or idioms or patterns would help in this case.
Thank you