[forward.list.erasure]

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

## 23.3 Sequence containers [[sequences]](sequences#forward.list.erasure)

### 23.3.7 Class template forward_list [[forward.list]](forward.list#erasure)

#### 23.3.7.7 Erasure [forward.list.erasure]

[ð](#lib:erase,forward_list)

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

[1](#1)

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

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

[ð](#lib:erase_if,forward_list)

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

[2](#2)

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

*Effects*: Equivalent to: return c.remove_if(pred);
