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 a snapshot of the master branch, built from commit 20a7dc9240.
PrevUpHomeNext
object::at (2 of 3 overloads)

Access the specified element, with bounds checking.

Synopsis
value&&
at(
    string_view key);
Description

Returns a 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