Why there is no std::copy_if algorithm?

后端 未结 6 1207
无人共我
无人共我 2020-12-03 04:23

Is there any specific reason for not having std::copy_if algorithm in C++ ? I know I can use std::remove_copy_if to achieve the required behavior. I think it is coming in C+

6条回答
  •  眼角桃花
    2020-12-03 04:41

    Stroustrup says they forgot it. It's in C++11.

    However, you can use remove_copy_if (which really should be called copy_if_not) along with not1 instead.

提交回复
热议问题