Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
basic_static_string::assign (11 of 12 overloads)

Replace the contents.

Synopsis
template<
    typename T,
    [role red error.class-detail-template.1][role red error.class-detail-template.2] = detail::enable_if_viewable_t<T, CharT, Traits>>
basic_static_string&
assign(
    const T& t,
    size_type pos,
    size_type count = npos);
Description

Replace the contents with a copy of the characters from string_view_type{t}.substr(pos, count) The range [pos, count) is extracted from the value obtained by converting t to string_view_type, and used to assign the string.

Exceptions

Type

Thrown On

std::out_of_range

if pos > string_view_type{t}.size()

std::length_error

if string_view_type{t}.substr(pos, count).size() > max_size()


PrevUpHomeNext