c++ - Is it more efficient to copy a vector by reserving and copying
https://stackoverflow.com/questions/644673/is-it-more-efficient-to-copy-a-vector-by-reserving-and-copying-or-by-creating-a
WebAug 1, 2020 · Do not use std::vector::swap. std::vector::swap is not copying a vector to another, it is actually swapping elements of two vectors, just as its name suggests. In other words, the source vector to copy from is modified after std::vector::swap is called, which is probably not what you are expected.
DA: 89 PA: 28 MOZ Rank: 77