title: Why doesn't specialization of std::hash() need to be injected into std namespace in this particular case?
body: <p>Consider </p>
  
  <pre><code>using namespace std;
  
  template &lt;typename S, typename T&gt; struct hash&lt;pair&lt;S, T&gt;&gt;
  {
      inline size_t operator()(const pair&lt;S, T&gt; &amp;v) const
      {
          return 0;
      }
  };
  </code></pre>
  
  <p>In this case both GCC and Clang compile it fine with no warnings. This however seems to contradict what I've read online that defining your own hash function to be used with the standard library's unordered types requires you to place the definition in the std namespace.</p>
  
  <p>Interestingly, specializing only for <code>pair&lt;int, int&gt;</code>: </p>
  
  <pre><code>template &lt;&gt; struct hash&lt;pair&lt;int, int&gt;&gt;
  {
      size_t operator()(const pair&lt;int, int&gt; &amp;v) const
      {
          size_t seed = 0;
          return seed;
      }
  };
  </code></pre>
  
  <p>leads to an error as we expect.</p>
  
  <p>However, why does the first not lead to any compiler warnings despite the fact that we are not placing it in the std namespace?</p>