title: STL Map with custom compare function object
body: <p>I want to use the STL's Map container to lookup a pointer by using binary data as a key so I wrote this custom function object:</p>
  
  <pre><code>struct my_cmp
  {
      bool operator() (unsigned char * const &amp;a, unsigned char * const &amp;b)
      {
          return (memcmp(a,b,4)&lt;0) ? true : false;  
      }
  };
  </code></pre>
  
  <p>And using it like this:</p>
  
  <pre><code>map&lt;unsigned char *, void *, my_cmp&gt; mymap;
  </code></pre>
  
  <p>This compiles and seems to work, but I'm not sure what an "unsigned char * const &amp;" type is and why it didn't work with just "unsigned char *"?</p>