Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
array::at (1 of 2 overloads)

Access an element, with bounds checking.

Synopsis
value&
at(
    std::size_t pos);
Description

Returns a reference to the element specified at location pos, with bounds checking. If pos is not within the range of the container, an exception of type std::out_of_range is thrown.

Complexity

Constant.

Parameters

Name

Description

pos

A zero-based index.

Exceptions

Type

Thrown On

std::out_of_range

pos >= size()


PrevUpHomeNext