Using boost::tuple in tr1::hash <p>I want to define <code>std::tr1::hash&lt;boost::tuple&lt;A,B,C&gt; &gt;</code>. But I get an error that doesn't appear when I give a complete instantation. Here's the code</p> <pre><code>namespace std{ namespace tr1{ template&lt;typename A, typename B, typename C&gt; struct hash&lt;boost::tuple&lt;A,B,C&gt; &gt;{ size_t operator()(const boost::tuple&lt;A,B,C&gt; &amp;t) const{ size_t seed = 0; boost::hash_combine(seed, t.get&lt;0&gt;()); boost::hash_combine(seed, t.get&lt;1&gt;()); boost::hash_combine(seed, t.get&lt;2&gt;()); return seed; } }; template&lt;&gt; struct hash&lt;boost::tuple&lt;int,int,int&gt; &gt;{ size_t operator()(const boost::tuple&lt;int,int,int&gt; &amp;t) const{ size_t seed = 0; boost::hash_combine(seed, t.get&lt;0&gt;()); boost::hash_combine(seed, t.get&lt;1&gt;()); boost::hash_combine(seed, t.get&lt;2&gt;()); return seed; } }; } } </code></pre> <p>The first piece gives this error</p> <pre><code>unordered.hpp: In member function 'size_t std::tr1::hash&lt;boost::tuples::tuple&lt;A, B, C, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;::operator()(const boost::tuples::tuple&lt;A, B, C, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt;&amp;) const': unordered.hpp:12: error: expected primary-expression before ')' token unordered.hpp:13: error: expected primary-expression before ')' token unordered.hpp:14: error: expected primary-expression before ')' token </code></pre> <p>and the second compiles just fine. What's wrong with the first template? I'm using gcc 4.3.4.</p>