title: std::initializer_list constructor
body: <p>In code like this:</p>
  
  <pre><code>#include &lt;iostream&gt; 
  #include &lt;initializer_list&gt;
  #include &lt;string&gt;
  
  struct A 
  {
    A() { std::cout &lt;&lt; "2" &lt;&lt; std::endl; }
    A(int a) { std::cout &lt;&lt; "0" &lt;&lt; std::endl; }
    A(std::initializer_list&lt;std::string&gt; s) { std::cout &lt;&lt; "3" &lt;&lt; std::endl; }
    A(std::initializer_list&lt;int&gt; l) { std::cout &lt;&lt; "1" &lt;&lt; std::endl; } 
  };
  
  int main() 
  { 
   A a1{{}}; 
  } 
  </code></pre>
  
  <p>Why does it call <code>std::initializer_list&lt;int&gt;</code> specification of constructor?
  It'll generate ambiguity compilation error if we define, for example, constructor with <code>std::initializer_list&lt;double&gt;</code>. What are the rules of such construction and why is it so specific about <code>std::initializer_list</code> with number as template argument?</p>