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

From Wikibooks, open books for an open world
< C++ Language‎ | Std‎ | Stl‎ | Algorithms‎ | Modifying
Jump to navigation Jump to search

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)