title: STL std::remove_copy
body: <pre><code> std::remove_copy
  
   template &lt;class InputIterator, class OutputIterator, class T&gt;  
   OutputIterator remove_copy (InputIterator first, InputIterator last,
                                 OutputIterator result, const T&amp; val);
  </code></pre>
  
  <blockquote>
    <p>Copy range removing value, Copies the elements in the range
    [first,last) to the range beginning at result, except those elements
    that compare equal to val. The output container must be large enough
    to hold the result.</p>
  </blockquote>
  
  <p>q1. <strong>Why the size of the output  container must be large enough to hold the result? Wont the container grow by itself?</strong></p>
  
  <p>q2. <strong>Why is the previous content in  the output container  overwritten when i perform a remove_copy?</strong> i.e When i perform a <code>remove_copy(a.begin(),a.end(),b.begin(),' ');</code> The previous content inside the container b are lost and they are replaced by the new contents why is it so? Why is the result of remove_copy not appended at the beginning of  the output container?</p>