Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
object::at (1 of 2 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