I have a function :
void get_good_items(const std::vector<T>& data,std::vector<XXX>& good_items);
This function should check all data and find items that satisfies a condition and return where they are in good_items.
what is best instead of std::vector<XXX>
?
std::vector<size_t>
that contains all good indices.std::vector<T*>
that contain a pointers to the items.std::vector<std::vector<T>::iterator>
that contains iterators to the items.- other ??
EDIT:
What will I do with the good_items
?
Many things... one of them is to delete them from the vector and save them in other place. maybe something else later
EDIT 2:
One of the most important for me is how will accessing the items in data
will be fast depending on the struct of good_items
?
EDIT 3:
I have just relized that my thought was wrong. Is not better to keep raw pointers(or smart) as items of the vector so I can keep the real values of the vector (which are pointers) and I do not afraid of heavy copy because they are just pointers?