title: Implementation of std::initializer_list
body: <p>I have been looking at how the <code>initializer_list</code> is implemented so I found section 18.9 of the standard and found a simple enough looking interface. I thought it would be instructive to make my own version which I named <code>MyNamespace::InitializerList</code> and a use case:</p>
  
  <pre><code>template&lt;class T&gt;
  class ArrayPrinter
  {
  public:
      ArrayPrinter(MyNamespace::InitializerList&lt;T&gt; list)
      {
          for (auto i : list) cout &lt;&lt; i &lt;&lt; endl;
      }
  };
  
  ...
  
  ArrayPrinter ap{ {1,2,3} };
  </code></pre>
  
  <p>I was surprised to find that this did not work and the compiler complained that it couldn't find a suitable constructor (it wanted to give me 3 arguments but section 18.9 only describes a default constructor).</p>
  
  <p>After a bit of fiddling I found that my class had to be named exactly <code>std::initializer_list</code> in order to work. I could also alias <code>std::initializer_list</code> it into <code>MyNamespace</code> but I could not alias <code>MyNamespace::InitializerList</code> as<code>std::initializer_list</code>.</p>
  
  <p>It seems that this it is not really a <a href="https://stackoverflow.com/questions/15198807/why-isnt-stdinitializer-list-a-language-built-in">language feature as it depends on the standard library</a>?</p>
  
  <p>The main point to my question is why the name is so important and what were those 3 arguments it was trying to pass to the constructor?</p>