Jump to content

C++ Language/Std/Stl/Algorithms/Modifying/Copying

From Wikibooks, open books for an open world

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)