title: C++11 initializer list with unique_ptr
body: <p>Having some issues getting the syntax correct for initializing a <code>vector</code> of <code>unique_ptr</code>.</p>
  
  <pre><code>class Thing
  {};
  class Spider: public Thing
  {};
  </code></pre>
  
  <p>Initially tried:</p>
  
  <pre><code>std::vector&lt;std::unique_ptr&lt;Thing&gt;&gt;  stuff{std::unique_ptr&lt;Thing&gt;(new Spider)};
  </code></pre>
  
  <p>But this requires copy constructor (which <code>unique_ptr</code> does not have).</p>
  
  <pre><code>game.cpp:62:46: note: in instantiation of member function 'std::__1::vector&lt;std::__1::unique_ptr&lt;Thing, std::__1::default_delete&lt;Thing&gt; &gt;, std::__1::allocator&lt;std::__1::unique_ptr&lt;Thing, std::__1::default_delete&lt;Thing&gt; &gt; &gt; &gt;::vector' requested here
          std::vector&lt;std::unique_ptr&lt;Thing&gt;&gt;  WestOfStartThings{std::unique_ptr&lt;Thing&gt;(new Spider)};
                                               ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2510:31: note: copy constructor is implicitly deleted because 'unique_ptr&lt;Thing, std::__1::default_delete&lt;Thing&gt; &gt;' has a user-declared move constructor
      _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&amp;&amp; __u) _NOEXCEPT
  </code></pre>
  
  <p>So I tried to get the move constructor to activate:</p>
  
  <pre><code>std::vector&lt;std::unique_ptr&lt;Thing&gt;&gt;  WestOfStartThings{std::move(std::unique_ptr&lt;Thing&gt;(new Spider))};
  </code></pre>
  
  <p>But still no luck.</p>
  
  <pre><code>game.cpp:62:46: note: in instantiation of member function 'std::__1::vector&lt;std::__1::unique_ptr&lt;Thing, std::__1::default_delete&lt;Thing&gt; &gt;, std::__1::allocator&lt;std::__1::unique_ptr&lt;Thing, std::__1::default_delete&lt;Thing&gt; &gt; &gt; &gt;::vector' requested here
          std::vector&lt;std::unique_ptr&lt;Thing&gt;&gt;  WestOfStartThings{std::move(std::unique_ptr&lt;Thing&gt;(new Spider))};
                                               ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2510:31: note: copy constructor is implicitly deleted because 'unique_ptr&lt;Thing, std::__1::default_delete&lt;Thing&gt; &gt;' has a user-declared move constructor
      _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&amp;&amp; __u) _NOEXCEPT
  </code></pre>