Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
object::count

Count the number of elements with a specific key.

Synopsis
std::size_t
count(
    string_view key) const;
Description

This function returns the count of the number of elements match key. The only possible return values are 0 and 1.

Complexity

Constant on average, worst case linear in size().

Exception Safety

No-throw guarantee.

Parameters

Name

Description

key

The key of the element to find.


PrevUpHomeNext