[unord.set.erasure]

# 23 Containers library [[containers]](./#containers)

## 23.5 Unordered associative containers [[unord]](unord#set.erasure)

### 23.5.6 Class template unordered_set [[unord.set]](unord.set#erasure)

#### 23.5.6.3 Erasure [unord.set.erasure]

[ð](#lib:erase_if,unordered_set)

`template<class K, class H, class P, class A, class Predicate>
  constexpr typename unordered_set<K, H, P, A>::size_type
    erase_if(unordered_set<K, H, P, A>& c, Predicate pred);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15045)

*Effects*: Equivalent to:auto original_size = c.size();for (auto i = c.begin(), last = c.end(); i != last; ) {if (pred(*i)) { i = c.erase(i); } else {++i; }}return original_size - c.size();
