title: C++'s unordered_map / hash_map / Google's dense_hash - how to input binary data (buf+len) and insert operation
body: <p>I have two questions about <a href="http://google-sparsehash.googlecode.com/svn/trunk/doc/dense_hash_map.html" rel="nofollow noreferrer">Google's dense_hash_map</a>, which can be used instead of the more standard unordered_map or hash_map:</p>
  
  <ol>
  <li><p>How do I use an arbitrary binary data memory segment as a key: I want a buffer+length pair, which may still contain some NUL (\0) characters. I can see how I use a NUL-terminated char * string , but that's not what I want.</p></li>
  <li><p>How do I implement an operation where I look if a key exists, and if not - insert it and if it does return the pointer to the existing key and let me know what actually happened.</p></li>
  </ol>
  
  <p>I'd appreciate it if anyone can shed any light on this subject.</p>
  
  <p>Regards,</p>
  
  <p>-- Shlomi Fish</p>