title: How can I reference a substr without creating a new object?
body: <p>I have several strings 2000 - 3000 characters in length and I would like to hash every substring with length X to an unordered_multimap. Thus I am traversing through each string character by character to determine each hash. The substr function creates a new string and so does inserting a std::pair into the multimap. I'd like to avoid as much as possible. Is there a way to work around this?</p>
  
  <p>Pseudo Code Example:</p>
  
  <pre><code>For each String str:
      For i to str.length - hashlength
          hash = str.substr(i, hashlength) //A
          unordered_multimap.insert({{hash, i}}); //B
  </code></pre>
  
  <p>I would prefer to have parts A and B use as little constructor calls as possible.</p>