title: std::list<std::unique_ptr>: empty initializer list vs. default constructor
body: <p>The code</p>
  
  <pre><code>#include &lt;list&gt;
  #include &lt;memory&gt;
  
  class B;
  class A {
      std::list&lt;std::unique_ptr&lt;B&gt;&gt; bs;
  public:
      A();
      ~A();
  };
  
  int main()
  {
      A x;
      return 0;
  }
  </code></pre>
  
  <p>obviously compiles. It doesn't link because <code>A::A()</code> and <code>A::~A()</code> are missing, but that is expected and alright. Changing</p>
  
  <pre><code>std::list&lt;std::unique_ptr&lt;B&gt;&gt; bs;
  </code></pre>
  
  <p>which is supposed to call the <code>std::list</code>'s standard constructor</p>
  
  <pre><code>list() : list(Allocator()) {}
  </code></pre>
  
  <p>(C++14 and up) to</p>
  
  <pre><code>std::list&lt;std::unique_ptr&lt;B&gt;&gt; bs{};
  </code></pre>
  
  <p>which is supposed to call <s>list(std::initializer_list, const Allocator &amp; = Allocator());</s>
  the default constructor too.
  (Thanks to <em>Nicol Bolas</em>, who rightly referred to [over.match.list] 13.3.1.7)
  gives the following error with <strong>c++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010</strong> and the <strong>--std=c++17</strong> parameter:</p>
  
  <pre><code>/usr/include/c++/5/bits/unique_ptr.h: In instantiation of ‘void std::default_delete&lt;_Tp&gt;::operator()(_Tp*) const [with _Tp = B]’:
  /usr/include/c++/5/bits/unique_ptr.h:236:17:   required from ‘std::unique_ptr&lt;_Tp, _Dp&gt;::~unique_ptr() [with _Tp = B; _Dp = std::default_delete&lt;B&gt;]’
  /usr/include/c++/5/bits/stl_list.h:106:12:   required from ‘void __gnu_cxx::new_allocator&lt;_Tp&gt;::destroy(_Up*) [with _Up = std::_List_node&lt;std::unique_ptr&lt;B&gt; &gt;; _Tp = std::_List_node&lt;std::unique_ptr&lt;B&gt; &gt;]’
  /usr/include/c++/5/bits/list.tcc:75:4:   required from ‘void std::__cxx11::_List_base&lt;_Tp, _Alloc&gt;::_M_clear() [with _Tp = std::unique_ptr&lt;B&gt;; _Alloc = std::allocator&lt;std::unique_ptr&lt;B&gt; &gt;]’
  /usr/include/c++/5/bits/stl_list.h:446:17:   required from ‘std::__cxx11::_List_base&lt;_Tp, _Alloc&gt;::~_List_base() [with _Tp = std::unique_ptr&lt;B&gt;; _Alloc = std::allocator&lt;std::unique_ptr&lt;B&gt; &gt;]’
  /usr/include/c++/5/bits/stl_list.h:507:11:   required from here
  /usr/include/c++/5/bits/unique_ptr.h:74:22: error: invalid application of ‘sizeof’ to incomplete type ‘B’
    static_assert(sizeof(_Tp)&gt;0,
                        ^
  </code></pre>
  
  <p>Which barks about the type of <code>B</code> being incomplete. My question is:</p>
  
  <p>Why does the <code>initializer_list</code> constructor need the complete type of <code>B</code> for an empty initializer list?</p>
  
  <p>Pointers to the relevant parts of the standard are always appreciated.</p>