Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
string::at (2 of 2 overloads)

Return a character with bounds checking.

Synopsis
char const&
at(
    std::size_t pos) const;
Description

Returns a reference to the character specified at location pos.

Complexity

Constant.

Exception Safety

Strong guarantee.

Parameters

Name

Description

pos

A zero-based index to access.

Exceptions

Type

Thrown On

system_error

pos >= size()


PrevUpHomeNext