title: Proper way of transferring ownership of a std::vector< std::unique_ptr< int> > to a class being constructed
body: <p>What is the proper way of transferring ownership of a <code>std::vector&lt;unique_ptr&lt;int&gt; &gt;</code> to a class being constructed?</p>
  
  <p>Below is a code representation of what I want to do. I realize it is not correct (won't compile) and violates "uniqueness" whether I pass the vector to the constructor by value or by reference. I want Foo to be the new owner of the vector, and want the calling function to relinquish ownership. Do I need the constructor to take a <code>std::unique_ptr&lt;std::vector&lt;std::unique_ptr&lt;int&gt; &gt; &gt;</code> to do this?</p>
  
  <p><strong>Foo.h</strong></p>
  
  <pre><code>class Foo
  {
  public:
    Foo(vector&lt;std::unique_ptr&lt;int&gt; &gt; vecOfIntPtrsOwnedByCaller);
  
  private:
    vector&lt;std::unique_ptr&lt;int&gt; &gt; _vecOfIntPtrsOwnedByFoo;
  }
  </code></pre>
  
  <p><strong>Foo.cpp</strong></p>
  
  <pre><code>Foo::Foo(std::vector&lt;std::unique_ptr&lt; int&gt; &gt; vecOfIntPtrsOwnedByCaller)
  {
      _vecOfIntPtrsOwnedByFoo = vecOfIntPtrsOwnedByCaller;
  }
  </code></pre>
  
  <p>Any help would be much appreciated - I've scoured the net looking for the correct way to do this. Thanks!</p>