[flat.set.erasure] (original) (raw)

23 Containers library [containers]

23.6 Container adaptors [container.adaptors]

23.6.11 Class template flat_set [flat.set]

23.6.11.6 Erasure [flat.set.erasure]

template<class Key, class Compare, class KeyContainer, class Predicate> constexpr typename flat_set<Key, Compare, KeyContainer>::size_type erase_if(flat_set<Key, Compare, KeyContainer>& c, Predicate pred);

Preconditions: Key meets the Cpp17MoveAssignable requirements.

Effects: Let E be bool(pred(as_const(e))).

Erases all elements e in c for which E holds.

Returns: The number of elements erased.

Complexity: Exactly c.size() applications of the predicate.

If an invocation of erase_if exits via an exception,c is in a valid but unspecified state ([defns.valid]).

[Note 1:

c still meets its invariants, but can be empty.

— _end note_]