title: Replace a bunch of std::vector entries
body: <p>I have a std::vector. I assign this vector like </p>
  
  <pre><code>vec.assign(20000, 0);
  </code></pre>
  
  <p>Now I have an additional array, which I want to insert into the vector. But NOT just like insert, more replace elements in the vector.</p>
  
  <pre><code>uint8_t a[] = {1,2,3,4,5,6,7,8};
  </code></pre>
  
  <p>Move that array into the vector on position x - x+8 without allocating new memory.</p>
  
  <p>What I tried and works is of course </p>
  
  <pre><code>vec.insert(start, a, a+8);
  </code></pre>
  
  <p>But there I am allocating new memory and the size of the vector changes, which is not supposed to happen.
  Yes, I could delete, the entries, which are too much, but there's still the problem, that I am allocating more memory. Isn't there a possibility, to just replace the array with the contents of the vector? Smth like that:</p>
  
  <pre><code>vec.replace(start, a, a+8);
  </code></pre>
  
  <p>I wanted to avoid replacing each element, cause I am afraid that could take too long.</p>
  
  <p>What do you think?
  Is there a way to do that?
  Have you had that problem before, too? How did you fix it?</p>