bsl::basic_string::assign

assign overloads

Synopses

Declared in <bslstl_string.h>

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

basic_string&
assign(BloombergLP::bslmf::MovableRef<basic_string> replacement) noexcept(false);
» more...

Assign a new value to this string.

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

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

basic_string&
assign(basic_string const& replacement);
» more...

Assign a new value to this string.

basic_string&
assign(CHAR_TYPE const* characterString);
» more...

Assign a new value to this string.

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

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);
» more...

Assign a new value to this string.

basic_string&
assign(
    size_type numChars,
    CHAR_TYPE character);
» more...

Assign a new value to this string.

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

Assign a new value to this string.

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

Assign a substring of replacement to this string.

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

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);
» more...

Return Value

  • reference providing modifiable access to this string
  • a reference to this string

Parameters

NameDescription
replacementstring whose value is move-assigned to this string
valuesinitializer list of characters
characterStringpointer to characters
stringnull-terminated character string
numCharsnumber of characters
charactercharacter value
firstbeginning of the range (inclusive)
lastend of the range (exclusive)
positionstarting index in replacement