Modifying transform copy_if replace
Transform, filter and replace elements with standard algorithms.
Modifying Algorithms
These algorithms write to an output range — either in place or to a destination iterator.
std::copy
Copy a range into another. The output range must be large enough or you must provide an inserter.
#include <algorithm>
#include <iterator>
std::vector<int> src = {1, 2, 3};
std::vector<int> dst;
std::copy(src.begin(), src.end(), std::back_inserter(dst));