title: I need to replace a range of elements in a vector
body: <p>I have an <code>std::vector</code> of certain size, and need to assign the contents of another vector (of size 34) to position 34 ... 67. The size of the original vector should not change. Looking at vector's <a href="http://www.cplusplus.com/reference/vector/vector/" rel="nofollow">API</a></p>
  
  <ul>
  <li><p><a href="http://www.cplusplus.com/reference/vector/vector/assign/" rel="nofollow">assign()</a> doesn't work as it replaces all the elements.</p></li>
  <li><p><a href="http://www.cplusplus.com/reference/vector/vector/swap/" rel="nofollow">swap()</a> doesn't work, since it replaces all the elements.</p></li>
  <li><p><a href="http://www.cplusplus.com/reference/vector/vector/emplace/" rel="nofollow">emplace()</a> doesn't work, as it creates a new element.</p></li>
  <li><p><a href="http://www.cplusplus.com/reference/vector/vector/reserve/" rel="nofollow">reserve()</a>, followed by a loop of <a href="http://www.cplusplus.com/reference/vector/vector/at/" rel="nofollow">at()</a> would work, but it would be nice to avoid the loop.</p></li>
  <li><p>memcpy(target.data[34], source.data(), 34 * sizeof(T)) would work without a loop, but looks like a C hack.</p></li>
  <li><p><a href="http://www.cplusplus.com/reference/algorithm/copy/" rel="nofollow">std::copy</a> would work nicely, but hiding away the loop I expect it to be slower than memcpy().</p></li>
  </ul>
  
  <p>The elements are integral numbers. Which should be the default approach, when changing a range of elements in a vector? </p>