title: how can I get a std::set of keys to a std::map
body: <p>I was writing an algorithm this morning and I ran into a curious situation.  I have two <code>std::map</code>s.  I want to perform a set intersection on the sets of the keys of each (to find which keys are common to both maps).  At some point in the future, I think it's likely I'll also want to perform set subtraction here as well.  Luckily, the STL includes functions for both of those operations.  The problem is, I can't seem to get a <code>std::set</code> of the keys out of a <code>std::map</code>.  Is there any way to do this?  I'm looking for something that would be this simple, like it is in Java:</p>
  
  <pre><code>std::set&lt;Foo&gt; keys = myMap.getKeySet();
  </code></pre>
  
  <p>My understanding is that I can't use the <code>std::set_intersection()</code> function directly on iterators into the maps because the maps expose <code>std::pair</code> objects instead of just keys.  Also, I don't think the map guarantees order.  I'm also interested in performing this same operation on a pair of <code>std::multimap</code>s, if that makes any difference.</p>
  
  <p><strong>EDIT</strong>: I forgot to mention initially that due to the age of the compiler I'm forced to use (MSVC++ 6), most of the nifty template tricks that are available in boost can not be used.</p>