I am reading this book called C ++ Accelerated. For the โcopyโ shown below
// error - no element at ret.end() copy(bottom.begin(), bottom.end(), ret.end());
The book mentions that it is not right to use ret.end () as the third argument. But ret.end () returns an iterator for the last one element of the 'ret' container. What is the problem with this argument? They suggest using back_inserter (ret) instead. Why is this so?
source share