[hive.erasure]

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

## 23.3 Sequence containers [[sequences]](sequences#hive.erasure)

### 23.3.9 Class template hive [[hive]](hive#erasure)

#### 23.3.9.6 Erasure [hive.erasure]

[ð](#lib:erase,hive)

`template<class T, class Allocator, class U = T>
  typename hive<T, Allocator>::size_type
    erase(hive<T, Allocator>& c, const U& value);
`

[1](#1)

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

*Effects*: Equivalent to:return erase_if(c, [&](const auto& elem) -> bool { return elem == value; });

[ð](#lib:erase_if,hive)

`template<class T, class Allocator, class Predicate>
  typename hive<T, Allocator>::size_type
    erase_if(hive<T, Allocator>& c, Predicate pred);
`

[2](#2)

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

*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();
