title: How to handle missing 'emplace_range' in C++0x STL?
body: <p>I have two containers, let's say they're defined like this:</p>
  
  <pre><code>std::vector&lt;std::unique_ptr&lt;int&gt;&gt; a;
  std::vector&lt;std::unique_ptr&lt;int&gt;&gt; b;
  </code></pre>
  
  <p>Assume both <code>a</code> and <code>b</code> are populated.  I want to insert the entire container <code>a</code>  to a particular location in <code>b</code>, using move-semantics so the <code>unique_ptr</code>s move to <code>b</code>.  Let's assume <code>i</code> is a valid iterator to somewhere in <code>b</code>.  The following doesn't work:</p>
  
  <pre><code>b.insert(i, a.begin(), a.end()); // error: tries to copy, not move, unique_ptrs
  </code></pre>
  
  <p>Is there another STL algorithm that can achieve this 'insert-range-by-moving'?  I guess I need a sort of <code>emplace_range</code>, but there isn't one in VS2010's STL. I don't want to write a loop that inserts one by one, since it would end up a nasty O(n^2) due to shifting up the entire contents of the vector every time it inserts. Any other options?</p>