title: Can I iterate over an std::map key range even if the boundary keys don't exist?
body: <p>I have a <code>std::map&lt;int, object&gt;</code>. </p>
  
  <p>If the map contains:</p>
  
  <pre><code>std::pair&lt;1, obj1&gt;
  std::pair&lt;3, obj2&gt;
  std::pair&lt;4, obj3&gt;
  std::pair&lt;6, obj4&gt;
  std::pair&lt;8, obj5&gt;
  std::pair&lt;9, obj6&gt;
  std::pair&lt;14, obj7&gt;
  </code></pre>
  
  <p><strong>Can I iterate across this map from non-existent keys</strong>, such as <code>i=5..10</code> (given that there are not actually any keys 5 and 10 in the map)? I would like to use such values to get output such as:</p>
  
  <pre><code>std::pair&lt;6, obj3&gt;
  std::pair&lt;8, obj3&gt;
  std::pair&lt;9, obj3&gt;
  </code></pre>
  
  <p>Alternatively, is there some other container that can do this? I would not like to use a vector, because in my program there are potentially large gaps between keys that actually contain values, and I don't want to have to iterate across thousands of empty indexes when there are only a few items, for example. </p>