std::erase, std::erase_if(std::list)
From cppreference.com
| Defined in header <list>
|
||
| (1) | ||
| (since C++20) (until C++26) |
||
| (since C++26) | ||
| (2) | (since C++20) (constexpr since C++26) |
|
1) Erases all elements that compare equal to value from the container c. Equivalent to
return c.remove_if([&](const auto& elem) -> bool { return elem == value; });.
2) Erases all elements that satisfy the predicate pred from the container c. Equivalent to
return c.remove_if(pred);.
Contents |