I would either use a set as described by lothar or use an sorted std::vector
as described in "Effective STL" chapter 23: "Consider replacing associative containers with sorted vectors".
The rational for this is that a std::binary_search
of a sorted vector with a custom comparitor is nearly as fast and sometimes faster than a map lookup and iteration is much faster. The insert operations are more expensive though (you have to call sort after each insert). A lot of map use cases insert very infrequently though.
The vector would be more flexibility than the set.
I replaced a map of 2000 complex objects (indexed by int) with this approach, iteration and processing every object in the map went from 50 seconds to less than 5 on a server class system. There was no noticeable difference for map lookups times.