Return the number of elements equivalent to the specified key.

Synopsis

Declared in <bdlc_flathashset.h>

template<class LOOKUP_KEY>
std::size_t
count(LOOKUP_KEY const& key) const
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
         && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;

Description

The behavior is undefined unless key is equivalent to at most one element in this unordered set. Note that since an unordered set maintains unique keys, the returned value will be either 0 or 1.

Return Value

1 if key is present, and 0 otherwise

Parameters

Name

Description

key

key to count

Created with MrDocs