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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…