| 20 | /// @return `last` |
| 21 | template <typename ForwardIterator, typename UnaryPredicate> |
| 22 | ForwardIterator removeIf(ForwardIterator first, ForwardIterator last, UnaryPredicate&& predicate) |
| 23 | { |
| 24 | auto found = findIf(first, last, forward<UnaryPredicate>(predicate)); |
| 25 | if (found != last) |
| 26 | { |
| 27 | auto it = found; |
| 28 | while (++it != last) |
| 29 | { |
| 30 | if (not predicate(*it)) |
| 31 | { |
| 32 | *found++ = move(*it); |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | return found; |
| 37 | } |
| 38 | |
| 39 | //! @} |
| 40 |