Re: Initialize a std::set with keys from a std::map
> Why? Is there a reason you can't just leave the data in the map, and
> temporarily ignore the associated data?
I was just thinking about that. I know the set is used in a
std::set_union algorithm downstream, so I'll have to figure if that
algorithm works with maps (and hash_maps) tomorrow. I checked the
set_union docs on sgi.com, but it's cryptic enough that I can't really
tell.
Daniel, your suggestion looks neat. If I can't avoid making the set
altogether I'll give that a try.
|