C++ Language/Std/Stl/Algorithms/Modifying/Copying
Appearance
If you have an appropriate callable-object, then copying can be conditional, with item-by-item testing of that condition: std::copy_if(src.begin(),src.end(),desti.begin(),IsOdd)
.
Additional information about copying algorithms (includes interactive examples)