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

Returns a view of a substring.

Exception Safety

Strong guarantee.

Return Value

this->subview().substr(pos, count)

Return Value

string_view(this->data(), this->size()).

Parameters

Name Description

pos

The index to being the substring at. The default argument for this parameter is 0.

count

The length of the substring. The default argument for this parameter is npos.

Exceptions

Type Thrown On

boost::system::system_error

pos > size().