object::contains

Return true if the key is found.

Synopsis

bool
contains(
    string_view key) const noexcept;

Description

Checks if there is an element with key equal to key.

Effects

return find(key) != end();

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.

See Also

find.