title: Is it possible to use range-based for loops with iterator ranges?
body: <p>Consider the usage with <code>std::multimap</code>, where I am given a range of iterators:</p>
  
  <pre><code>std::unordered_multimap&lt;std::string, MyObject&gt; mymap;
  
  auto&amp; range = mymap.equal_range("some_key");
  for (auto&amp; the_pair : range)
  {
  }
  </code></pre>
  
  <p>Now, the code above does not compile, but I am using it for demonstration purposes. Is it possible to use range-based for loops with a pair of iterators like this? I don't imagine it is possible directly, so I guess my question is really about whether or not there is an adapter class in STL for this use case. I could probably write my own but this seems like a common case.</p>
  
  <h1>Update:</h1>
  
  <p>If this is not a common case and STL does not provide such a proxy or adapter for this type of usage, what is required to implement them? I was thinking that I'd need to overload the free functions <code>begin</code> and <code>end</code> and also define an adapter iterator class for <code>std::pair&lt;T,U&gt;</code>. I'm just taking a conceptual stab at it, but please let me know! Thanks in advance everyone.</p>