Where is erase_if?

后端 未结 6 1142
不思量自难忘°
不思量自难忘° 2021-01-07 20:51

I\'ve got a container and would like to erase elements based on a predicate. erase_if sounds familiar, but I can\'t find it in C++. What\'s the name and where i

6条回答
  •  一整个雨季
    2021-01-07 21:41

    There is a list::remove_if, but not for all container classes. remove_if also exists as a algorithm, which can be used with the iterators you can get from begin() and end().

提交回复
热议问题