string::subview

Return a view.

Synopsis

string_view
subview(
    std::size_t pos,
    std::size_t count = string::npos) const; (1)

string_view
subview() const noexcept; (2)

Description

  • (1) equivalent to subview().substr(pos, count).

  • (2) equivalent to string_view(data(), size()).

Exception Safety

Strong guarantee.

Parameters

Name Description

pos

The index of the first character of the substring.

count

The length of the substring.

Exceptions

Type Thrown On

boost::system::system_error

pos > size().