[#bsl-erase_if-071] = xref:bsl.adoc[bsl]::erase_if :relfileprefix: ../ :mrdocs: `erase_if` overloads == Synopses Declared in `<bslstl_deque.h>` Erase every element of `deq` that satisfies `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE_TYPE, class ALLOCATOR, class PREDICATE> deque<VALUE_TYPE, ALLOCATOR>::size_type xref:bsl/erase_if-0b.adoc[erase_if]( xref:bsl/deque-0c.adoc[deque<VALUE_TYPE, ALLOCATOR>]& deq, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-0b.adoc[_» more..._]# Erase all elements in `l` that satisfy the specified `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class ALLOCATOR, class PREDICATE> bsl::list<VALUE, ALLOCATOR>::size_type xref:bsl/erase_if-076.adoc[erase_if]( xref:bsl/list-054.adoc[list<VALUE, ALLOCATOR>]& l, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-076.adoc[_» more..._]# Erase all the elements in the specified vector `vec` that satisfy the specified predicate `predicate`. Return the number of elements erased. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE_TYPE, class ALLOCATOR, class PREDICATE> vector<VALUE_TYPE, ALLOCATOR>::size_type xref:bsl/erase_if-03a.adoc[erase_if]( xref:bsl/vector-00d.adoc[vector<VALUE_TYPE, ALLOCATOR>]& vec, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-03a.adoc[_» more..._]# Erase all characters matching a predicate from a string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR, class UNARY_PREDICATE> bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>::size_type xref:bsl/erase_if-0e.adoc[erase_if]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& str, UNARY_PREDICATE const& pred); ---- [.small]#xref:bsl/erase_if-0e.adoc[_» more..._]# Erase all elements in `ms` that satisfy `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class COMPARATOR, class ALLOCATOR, class PREDICATE> bsl::multiset<KEY, COMPARATOR, ALLOCATOR>::size_type xref:bsl/erase_if-030.adoc[erase_if]( xref:bsl/multiset-03.adoc[multiset<KEY, COMPARATOR, ALLOCATOR>]& ms, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-030.adoc[_» more..._]# Erase all elements in `s` that satisfy `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class COMPARATOR, class ALLOCATOR, class PREDICATE> bsl::set<KEY, COMPARATOR, ALLOCATOR>::size_type xref:bsl/erase_if-04.adoc[erase_if]( xref:bsl/set-0d.adoc[set<KEY, COMPARATOR, ALLOCATOR>]& s, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-04.adoc[_» more..._]# Erase every element of `m` that satisfies `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class COMPARATOR, class ALLOCATOR, class PREDICATE> bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type xref:bsl/erase_if-01.adoc[erase_if]( xref:bsl/map-0a7.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>]& m, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-01.adoc[_» more..._]# Erase every element of `m` that satisfies `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class COMPARATOR, class ALLOCATOR, class PREDICATE> bsl::multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type xref:bsl/erase_if-0f.adoc[erase_if]( xref:bsl/multimap-0ae.adoc[multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>]& m, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-0f.adoc[_» more..._]# Erase all elements in `ms` that satisfy `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class HASH, class EQUAL, class ALLOCATOR, class PREDICATE> bsl::unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>::size_type xref:bsl/erase_if-074.adoc[erase_if]( xref:bsl/unordered_multiset-06c.adoc[unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>]& ms, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-074.adoc[_» more..._]# Erase elements from `s` that satisfy `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class HASH, class EQUAL, class ALLOCATOR, class PREDICATE> bsl::unordered_set<KEY, HASH, EQUAL, ALLOCATOR>::size_type xref:bsl/erase_if-0d.adoc[erase_if]( xref:bsl/unordered_set-0d2d.adoc[unordered_set<KEY, HASH, EQUAL, ALLOCATOR>]& s, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-0d.adoc[_» more..._]# Erase every element of `m` that satisfies `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR, class PREDICATE> bsl::unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type xref:bsl/erase_if-0a4.adoc[erase_if]( xref:bsl/unordered_map-02b.adoc[unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>]& m, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-0a4.adoc[_» more..._]# Erase every element of `m` that satisfies `predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR, class PREDICATE> bsl::unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type xref:bsl/erase_if-0aa.adoc[erase_if]( xref:bsl/unordered_multimap-0b0.adoc[unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>]& m, PREDICATE predicate); ---- [.small]#xref:bsl/erase_if-0aa.adoc[_» more..._]# == Return Value * number of elements erased * number of characters erased == Parameters [cols="1,4"] |=== | Name| Description | *deq* | deque from which matching elements are erased | *predicate* | unary predicate selecting elements to erase | *l* | list from which to erase elements | *vec* | vector to modify | *str* | string to modify | *pred* | unary predicate selecting characters to erase | *ms* | multiset from which to erase elements | *s* | set from which to erase elements | *m* | map from which matching elements are erased |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#