Assume I have two non-constant iterators begin and end. I want to completely replace the range between begin and end with values, that are between two other iterators. I know with non-constant iterators I can use the following syntax.
*begin = *result.begin();
*end = *result.end();
But this will only change the values behind begin and end iterators
To be more precise. I have an initial vector
{1, 2, 3, 4, 5, 6, 7}
^ ^
begin end
and some other vector called result, which contains
{6, 6, 3, 5, 4, 13, 99}
^ ^
begin end
at the end I want my initial array to look like
{6, 3, 5, 4, 5, 6, 7}
See Question&Answers more detail:os