I have two vectors:
std::vector<int> v1, v2;
// Filling v1
...
And now I need to copy v1
to v2
. Is there any reason to prefer
v2 = v1;
to
std::copy (v1.begin(), v1.end(), v2.begin());
(or vice versa)?
See Question&Answers more detail:os