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::at (2 of 2 overloads)

Access the specified element, with bounds checking.

Synopsis
value const&
at(
    string_view key) const;
Description

Returns a constant reference to the mapped value of the element that matches key, otherwise throws.

Complexity

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

Exception Safety

Strong guarantee.

Return Value

A reference to the mapped value.

Parameters

Name

Description

key

The key of the element to find.

Exceptions

Type

Thrown On

std::out_of_range

if no such element exists.


PrevUpHomeNext