[#bsl-erase_if-04]
= xref:bsl.adoc[bsl]::erase&lowbar;if
:relfileprefix: ../
:mrdocs:

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class COMPARATOR,
    class ALLOCATOR,
    class PREDICATE&gt;
bsl::set&lt;KEY, COMPARATOR, ALLOCATOR&gt;::size&lowbar;type
erase&lowbar;if(
    xref:bsl/set-0d.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;]& s,
    PREDICATE predicate);
----


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