title: std::unordered_map constructor with initializer_list and size compiles in main, but not in class definition
body: <p>I am trying to initialize an <code>std::unordered_map</code> using the constructor that accepts data through an initialization list and the initial number of buckets. </p>
  
  <p>For some reason, that constructor works if I put it in <code>main</code>, but has a syntax error when I put it in a class header.</p>
  
  <p>Specifically, the header, called <code>momo.h</code>:</p>
  
  <pre><code>#pragma once
  #include &lt;unordered_map&gt;
  
  namespace std 
  {
     template &lt;&gt;
     struct hash&lt;std::pair&lt;uint16_t, uint16_t&gt;&gt;
     {
        std::size_t operator()(const std::pair&lt;uint16_t, uint16_t&gt;&amp; k) const
        {
           return (std::hash&lt;long&gt;()((((long)k.first) &lt;&lt; 16) + (long)k.second));
        }
     };
  }
  
  class test
  {
     std::unordered_map&lt;std::pair&lt;uint16_t, uint16_t&gt;, uint16_t&gt; m_Z(
        { /* Fails here: syntax error: missing ')' before '{' */
            {std::pair{ 1, 2 }, 3},
            {std::pair{ 4, 5 }, 6}
        }, 128);
  
  };
  </code></pre>
  
  <p>While if I remove the definition from the header into <code>main</code> thus:</p>
  
  <pre><code>#include "Momo.h"
  
  int main()
  {
     test X;
  
     std::unordered_map&lt;std::pair&lt;uint16_t, uint16_t&gt;, uint16_t&gt; Y(
        {
            {std::pair{ 1, 2 }, 3},
            {std::pair{ 4, 5 }, 6}
        }, 128);
  }
  </code></pre>
  
  <p>The code compiles without error. Why?</p>