title: std::initializer_list not able to be deduced from <brace-enclosed initializer list>
body: <p>I have a class whose constructor takes an <code>initializer_list</code>:</p>
  
  <pre><code>Foo::Foo(std::initializer_list&lt;Bar*&gt; bars)
  </code></pre>
  
  <p>If I attempt to create an object with a <em>brace-enclosed initializer list</em> <strong>directly</strong>, the <code>initializer_list</code> is correctly deduced:</p>
  
  <pre><code>Foo f ({ &amp;b }); // std::initializer_list&lt;Bar*&gt; correctly deduced
  </code></pre>
  
  <p>However, when trying to do the same <strong>indirectly</strong> (with a variadic function template - in this case <code>make_unique</code>), the compiler is unable to deduce  the <code>initializer_list</code>:</p>
  
  <pre><code>std::make_unique&lt;Foo&gt;({ &amp;b }); // std::initializer_list&lt;Bar*&gt; not deduced
  </code></pre>
  
  <p><strong>Error output:</strong></p>
  
  <blockquote>
    <p>error: no matching function for call to <code>‘make_unique(&lt;brace-enclosed initializer list&gt;)’</code></p>
  </blockquote>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li>Why is the compiler failing to deduce <code>{ &amp;b }</code> as a <code>initializer_list&lt;Boo*&gt;</code>?</li>
  <li>Is it possible to use the syntax <code>std::make_unique&lt;Foo&gt;({ &amp;b })</code> which I desire?</li>
  </ul>
  
  <p><strong>Full example below:</strong></p>
  
  <pre><code>#include &lt;initializer_list&gt;
  #include &lt;memory&gt;
  
  struct Bar
  {};
  
  struct Foo
  {
      Foo(std::initializer_list&lt;Bar*&gt; bars)
      { }
  };
  
  int main()
  {
      Bar b;
  
      // initializer_list able to be deduced from { &amp;b }
      Foo f ({ &amp;b });
  
      // initializer_list not able to be deduced from { &amp;b }
      std::unique_ptr&lt;Foo&gt; p = std::make_unique&lt;Foo&gt;({ &amp;b });
  
      (void)f;
      return 0;
  }
  </code></pre>