If efficiency is an issue, and if you are doing a lot of deleting-by-position (and maybe also inserting), consider using other container than std::vector --- sdt::list (linked-list container) or std::set (container where the key is the values themselves)