copy function arguments in c++
<p>I'm reading this book called accelerated c++.For 'copy' shown below</p>

<pre><code>// error - no element at ret.end() 
copy(bottom.begin(), bottom.end(), ret.end());
</code></pre>

<p>It is mentioned in the book that it is not quiet right to use ret.end() as the third argument.But ret.end() returns the iterator for one past the last element of 'ret' container.What is the problem with this argument?They are suggesting to use 'back_inserter(ret)' instead.Why is that so?</p>
