Provides access to the data contained in the string.
- Parameters
-
| __n | The index of the character to access. |
- Returns
- Read/write reference to the character.
- Exceptions
-
This function provides for safer data access. The parameter is first checked that it is in the range of the string. The function throws out_of_range if the check fails. Success results in unsharing the string.
Definition at line 1192 of file cow_string.h.
1193 {
1196 "(which is %zu) >= this->size() "
1197 "(which is %zu)"),
1201 }
void __throw_out_of_range_fmt(const char *,...)
constexpr size_type size() const noexcept
Returns the number of characters in the string, not including any null-termination.
constexpr pointer _M_data() const
Managing sequences of characters and character-like objects.