BloombergLP::bslstl::StringRefImp::operator[]

Return a reference to the character at the specified index.

Synopsis

Declared in <bslstl_stringref.h>

StringRefImp<CHAR_TYPE>::const_reference
operator[](size_type index) const;

Description

Return a reference providing a non-modifiable access to the character at the specified index in the string bound to this reference. This reference remains valid as long as the string currently bound to this object remains valid. The behavior is undefined unless 0 <= index < length().

Return Value

non-modifiable reference to the character at index

Parameters

NameDescription
indexposition of the character to access