I was just wondering why std::copy() returns an OutputIterator.
Code:template<class InputIterator, class OutputIterator>
OutputIterator copy ( InputIterator first, InputIterator last, OutputIterator result )
{
while (first!=last)
*result++ = *first++;
return result;
}
when it could have returned void, which works in almost the same way. Is there any valid usage of the iterator returned by copy() ?