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 develop branch, built from commit e7590a0093.
PrevUpHomeNext
value::at (3 of 6 overloads)

Access an element, with bounds checking.

Synopsis
value const&
at(
    string_view key,
    boost::source_location const& loc = BOOST_CURRENT_LOCATION) const&;
Description

This function is used to access elements of the underlying object, or throw an exception if the value is not an object.

Complexity

Constant.

Exception Safety

Strong guarantee.

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.

Return Value

this->as_object(loc).at( key, loc ).


PrevUpHomeNext