title: Variadic template expansion, inheritance, and std::unique_ptr
body: <p>I have code that works like this:</p>
  
  <pre><code>#include &lt;memory&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  struct A {
      virtual ~A() = default;
  };
  
  struct B : public A {
  };
  
  template&lt;typename... Ts&gt; struct C {
      C() : v_({new Ts...}) {}
  
      ...
  
      std::vector&lt;A*&gt; v_;
  };
  
  ...
  
  C&lt;B, B, A&gt; bba;
  </code></pre>
  
  <p>I'd like to use <code>std::unique_ptr</code> and <code>std::make_unique</code> to avoid calling <code>new</code> explicitly and iterating over <code>v_</code> to delete it in destructor (<code>v_</code> will become <code>std::vector&lt;std::unique_ptr&lt;A&gt;&gt;</code>) but can't figure out how to marry up <code>std::make_unique</code> with initialization list and variadic expansion (I suspect due to <code>std::unique_ptr</code> being move-only). Any suggestions? </p>