Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit 6ec3fdb23a.
PrevUpHomeNext
basic_static_string::erase (1 of 3 overloads)

Erase from the string.

Synopsis
constexpr basic_static_string&
erase(
    size_type index = 0,
    size_type count = npos);
Description

Erases num characters from the string, starting at index. num is determined as the smaller of count and size() - index.

Exception Safety

Strong guarantee.

Remarks

All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.

Return Value

*this

Parameters

Name

Description

index

The index to erase at. The default argument for this parameter is 0.

count

The number of characters to erase. The default argument for this parameter is npos.

Exceptions

Type

Thrown On

std::out_of_range

index > size()


PrevUpHomeNext