title: Elegant way to find keys with given prefix in std::map or elements in std::set
body: <p>I have map, which keys are std::string. I want to find those elements in the map which starts with <code>"DUPA/"</code> prefix. Finding lower bound is easy but upper bound is a bit problematic. I wrote such piece of code:</p>
  
  <pre><code>const char* prefix = "DUPA/";
  const char* firstAfterPrefix = "DUPA0";
  auto prefixedBeginIt = myMap.upper_bound(prefix);
  auto prefixedEndIt = myMap.lower_bound(firstAfterPrefix);
  </code></pre>
  
  <p>The code works fine but I don't consider it to be elegant, as one has to know that <code>0</code> is first next to <code>/</code> in ASCII table. Second way would be to copy prefix and increment last sign. Do you know more elegant solution?</p>