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

object::at (2 of 3 overloads)
PrevUpHomeNext

Access the specified element, with bounds checking.

Synopsis
value&&
at(
    string_view key,
    boost::source_location const& loc = BOOST_CURRENT_LOCATION) &&;
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.

loc

source_location to use in thrown exception; the source location of the call site by default.

Exceptions

Type

Thrown On

boost::system::system_error

if no such element exists.


PrevUpHomeNext