[#BloombergLP-bslstl-AlgorithmUtil-containerEraseIf]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/AlgorithmUtil.adoc[AlgorithmUtil]::containerEraseIf
:relfileprefix: ../../../
:mrdocs:

Erase all the elements in the specified container `container` that satisfy the specified predicate `predicate`&period; Return the number of elements erased&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;algorithm&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CONTAINER,
    class PREDICATE&gt;
static
CONTAINER::size&lowbar;type
containerEraseIf(
    CONTAINER& container,
    PREDICATE predicate);
----

== Return Value

the number of elements erased

== Parameters

[cols="1,4"]
|===
| Name| Description
| *container*
| container from which matching elements are erased
| *predicate*
| unary predicate selecting elements to erase
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
