title: Get value in map for known hash output
body: <p>I have an <code>std::unordered_map</code> <code>myMap</code> with key, value pairs of <code>&lt;Key*, Value&gt;</code>. <code>Key</code> is defined as so:</p>
  
  <pre><code>struct Key
  {
      unsigned long int UniqueValue;
      unsigned long int NonnUniqueValue;
  }
  </code></pre>
  
  <p>The rest of the program ensures that <code>UniqueValue</code> is unique for every instance of <code>Key</code>, however <code>NonUniqueValue</code> can be different between keys. My hash function is then defined as:</p>
  
  <pre><code>struct KeyHash
  {
      std::size_t operator()(const Key&amp; k) const
      {
          return k.UniqueValue;
      }
  }
  </code></pre>
  
  <p>and my map is then:</p>
  
  <pre><code>std::unordered_map&lt;Key*, Value, KeyHash&gt; myMap;
  </code></pre>
  
  <p>So, basically, each key already knows it's own hash value. I want to be able to reference the key, value pair by both the <code>Key</code> instance itself and the <code>UniqueValue</code>. Since the hash value is already known, can I use this to directly reference value?</p>
  
  <p>For instance, if I have two instances of <code>Key</code> <code>k1</code> and <code>k2</code> where <code>k1.UniqueValue = 2</code>, <code>k2.UniqueValue = 5</code>, <code>k1.NonUniqueValue = 42</code>, and <code>k2.NonUniqueValue = 42</code>, I want to be able to reference the value in <code>myMap</code> with key <code>k1</code> knowing only <code>k1.UniqueValue</code>.</p>
  
  <p>Is this possible to do without directly modifying <code>Key</code>? </p>