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 an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
array::try_at (2 of 2 overloads)

Access an element, with bounds checking.

Synopsis
boost::system::result< value const & >
try_at(
    std::size_t pos) const noexcept;
Description

Returns boost::system::result containing a reference to the element specified at location pos, if pos is within the range of the container. Otherwise the result contains an error_code.

Exception Safety

No-throw guarantee.

Parameters

Name

Description

pos

A zero-based index.

Complexity

Constant.


PrevUpHomeNext