title: Magic number in boost::hash_combine
body: <p>The <code>boost::hash_combine</code> template function takes a reference to a hash (called <code>seed</code>) and an object <code>v</code>. According to the <a href="http://www.boost.org/doc/libs/release/doc/html/hash/reference.html#boost.hash_combine" rel="noreferrer">docs</a>, it combines <code>seed</code> with the hash of <code>v</code> by</p>
  <pre class="lang-cpp prettyprint-override"><code>seed ^= hash_value(v) + 0x9e3779b9 + (seed &lt;&lt; 6) + (seed &gt;&gt; 2);
  </code></pre>
  <p>I can see that this is deterministic. I see why a XOR is used.</p>
  <p>I bet the addition helps in mapping similar values widely apart so probing hash tables won't break down, but can someone explain what the magic constant is?</p>