[#bsl-set-0d-count-03]
= xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::count
:relfileprefix: ../../
:mrdocs:

Return the number of elements equivalent to `key`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/set-0d/size_type.adoc[size&lowbar;type]
count(LOOKUP&lowbar;KEY const& key) const
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

== Description

Note that although a set maintains unique keys, the returned value can be other than 0 or 1, because a transparent comparator may have been supplied that provides a different (but compatible) partitioning of keys for `LOOKUP&lowbar;KEY` as the comparisons used to order the keys in the set&period;

Note&colon; implemented inline due to Sun CC compilation error&period;

== Return Value

number of elements equivalent to `key`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key value to look up
|===


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