array::at
Access an element, with bounds checking.
Synopsis
value&
at(
std::size_t pos,
boost::source_location const& loc = BOOST_CURRENT_LOCATION) &; (1)
value&&
at(
std::size_t pos,
boost::source_location const& loc = BOOST_CURRENT_LOCATION) &&; (2)
value const&
at(
std::size_t pos,
boost::source_location const& loc = BOOST_CURRENT_LOCATION) const&; (3)
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 boost::system::system_error
is thrown.
Complexity
Constant.
Parameters
Name | Description |
---|---|
|
A zero-based index. |
|
|
Exceptions
Type | Thrown On |
---|---|
|
|