title: Hash value for a std::unordered_map
body: <p>According to the standard there's no support for containers (let alone unordered ones) in the <code>std::hash</code> class. So I wonder how to implement that. What I have is:</p>
  
  <pre><code>std::unordered_map&lt;std::wstring, std::wstring&gt; _properties;
  std::wstring _class;
  </code></pre>
  
  <p>I thought about iterating the entries, computing the individual hashes for keys and values (via <code>std::hash&lt;std::wstring&gt;</code>) and concatenate the results somehow.</p>
  
  <p>What would be a good way to do that and does it matter if the order in the map is not defined?</p>
  
  <p>Note: I don't want to use boost.</p>
  
  <p>A simple XOR was suggested, so it would be like this:</p>
  
  <pre><code>size_t MyClass::GetHashCode()
  {
    std::hash&lt;std::wstring&gt; stringHash;
    size_t mapHash = 0;
    for (auto property : _properties)
      mapHash ^= stringHash(property.first) ^ stringHash(property.second);
  
      return ((_class.empty() ? 0 : stringHash(_class)) * 397) ^ mapHash;
  }
  </code></pre>
  
  <p>?</p>
  
  <p>I'm really unsure if that simple XOR is enough.</p>