title: Invalid use of incomplete type struct std::hash with unordered_map with std::pair of enum class as key
body: <p>I want to use a <code>unordered_map&lt;std::pair&lt;enum_class,other_enum_class&gt;,std::uint8_t&gt;</code> for managing some pixelmap formats.  </p>
  
  <p>Here the minimal code :</p>
  
  <pre><code>#include &lt;unordered_map&gt;
  #include &lt;utility&gt;
  #include &lt;cstdint&gt; 
  #include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  enum class PNM : std::uint8_t { PBM, PGM, PPM };
  enum class Format : bool      { BIN, ASCII };
  
  struct pair_hash {
  public:
      template &lt;typename T, typename U&gt;
      std::size_t operator()(const std::pair&lt;T, U&gt; &amp;x) const { 
          return std::hash&lt;T&gt;()(x.first) ^ std::hash&lt;U&gt;()(x.second); 
      }
  };
  
  int main(){
  
      std::unordered_map&lt;std::pair&lt;PNM, Format&gt;, std::uint8_t, pair_hash&gt; k_magic_number ({
          { { PNM::PBM, Format::BIN   }, 1 }, { { PNM::PGM, Format::BIN   }, 2 }, { { PNM::PPM, Format::BIN   }, 3 },
          { { PNM::PBM, Format::ASCII }, 4 }, { { PNM::PGM, Format::ASCII }, 5 }, { { PNM::PPM, Format::ASCII }, 6 }
      });
  
      std::cout &lt;&lt; k_magic_number[std::make_pair&lt;PNM, Format&gt;(PNM::PBM, Format::BIN)];
  }
  </code></pre>
  
  <p>With GCC I have an <a href="http://coliru.stacked-crooked.com/a/2282aee6b7b7527a" rel="noreferrer">error</a> when I try to instantiate the class :</p>
  
  <blockquote>
    <p>main.cpp:14:24: error: invalid use of incomplete type 'struct std::hash'<br>
       return std::hash()(x.first) ^ std::hash()(x.second);<br>
    In file included from<br>
    /usr/local/include/c++/5.2.0/bits/basic_string.h:5469:0,<br>
                     from /usr/local/include/c++/5.2.0/string:52,<br>
    [...] </p>
  </blockquote>
  
  <p>With Clang I also have an <a href="http://coliru.stacked-crooked.com/a/f5b13e61a5e141a3" rel="noreferrer">error</a> :</p>
  
  <blockquote>
    <p>error: implicit instantiation of undefined template 'std::hash'
                    return std::hash()(x.first) ^ std::hash()(x.second); 
    /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/bits/hashtable_policy.h:1257:16:
    note: in instantiation of function template specialization
    'pair_hash::operator()' requested here
    [...]</p>
  </blockquote>
  
  <p>With VS2013 I have no error and the code compile and executes.</p>
  
  <p>What is missing in my code ?</p>