Actually I think the std::unsorted_set would be better, but if you don't need random access, using a list would be a better approach -- fast insert, fast remove and fast iterate