assign overloads

Synopses

Declared in <bslstl_string.h>

Assign to this string the value of the specified replacement string.

Assign a new value to this string.

basic_string&
assign(std::initializer_list<CHAR_TYPE> values);

Assign to this string the value of the specified replacement string.

basic_string&
assign(basic_string const& replacement);

Assign a new value to this string.

basic_string&
assign(CHAR_TYPE const* characterString);

Assign a new value to this string.

template<class STRING_VIEW_LIKE_TYPE>
basic_string&
assign(STRING_VIEW_LIKE_TYPE const& replacement);

Assign to this string the value of the specified string, and return a reference providing modifiable access to this string.

template<class ALLOC2>
basic_string&
assign(std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& string);

Assign a new value to this string.

basic_string&
assign(
    size_type numChars,
    CHAR_TYPE character);

Assign a new value to this string.

basic_string&
assign(
    CHAR_TYPE const* characterString,
    size_type numChars);

Assign a new value to this string.

template<class INPUT_ITER>
basic_string&
assign(
    INPUT_ITER first,
    INPUT_ITER last);

Assign a substring of replacement to this string.

basic_string&
assign(
    basic_string const& replacement,
    size_type position,
    size_type numChars = npos);

Assign a new value to this string.

template<class STRING_VIEW_LIKE_TYPE>
basic_string&
assign(
    STRING_VIEW_LIKE_TYPE const& replacement,
    size_type position,
    size_type numChars = npos);

Return Value

  • reference providing modifiable access to this string

  • a reference to this string

Parameters

Name

Description

replacement

string whose value is move‐assigned to this string

values

initializer list of characters

characterString

pointer to characters

string

null‐terminated character string

numChars

number of characters

character

character value

first

beginning of the range (inclusive)

last

end of the range (exclusive)

position

starting index in replacement

Created with MrDocs