title: How to extend std::tr1::hash for custom types?
body: <p>How do I allow the STL implementation to pick up my custom types? On MSVC, there is a class <code>std::tr1::hash</code>, which I can partially specialize by using</p>
  
  <pre><code>namespace std 
  {
      namespace tr1 
      { 
          template &lt;&gt; 
          struct hash&lt;MyType&gt; 
          { ... };
      } 
  }
  </code></pre>
  
  <p>but is this the recommended way? Moreover, does this work with GCC's implementation as well? For <code>boost::hash</code>, it's enough to provide a free function <code>size_t hash_value (const MyType&amp;)</code>, is there something similar for the TR1 implementation?</p>