Daily bit(e) of C++ | std::copy_if, std::remove_copy_if

Daily bit(e) of C++ #71, The conditional copy algorithms: std::copy_if and std::remove_copy_if

If we need selectively copy elements from one range to another, the standard offers the std::copy_if and std::remove_copy_if algorithms.

Both algorithms accept a predicate, copying elements for which the predicate returns true and false respectively.

Open the example in Compiler Explorer.

--

--

I'm an ex-Software Engineer and ex-Researcher focusing on providing free educational content.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Šimon Tóth

I'm an ex-Software Engineer and ex-Researcher focusing on providing free educational content.