I understand this question may be quickly flagged as a duplicate of many other more popular questions, but I’ll still ask it:
I need a container that provides duplicate checking on insert (like std::set, but allows me to modify elements already present (like std::vector). It should also be relatively fast to search for elements (which would prefer std::set again). Would it be better to use a vector and perhaps a custom duplicate-checking insert_iterator instead of modifying set elements by erasing and reinserting them?
Thanks
What is to stop you from using a
std::set? If you need to modify an element, copy it, erase it, then re-insert.