Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
string::at (1 of 2 overloads)

Return a character with bounds checking.

Synopsis
char&
at(
    std::size_t pos);
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

std::out_of_range

pos >= size()


PrevUpHomeNext