[#bsl-basic_string-01d-operator_assign-07a] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-01d.adoc[basic_string<char8_t>]::operator= :relfileprefix: ../../ :mrdocs: Assignment operators == Synopses Declared in `<bslstl_string.h>` Assign to this string the value of the string of length one consisting of the specified `character`, and return a reference providing modifiable access to this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-070.adoc[operator=](char8_t character); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-070.adoc[_» more..._]# Move‐assign from the specified `rhs` string and return `*this`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-00.adoc[operator=](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<basic_string<char8_t>>] rhs) noexcept(/* see-below */); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-00.adoc[_» more..._]# Assign to this string the value resulting from first clearing this string and then inserting (in order) each `CHAR_TYPE` object in the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-0ad.adoc[operator=](std::initializer_list<char8_t> values); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-0ad.adoc[_» more..._]# Assign to this string the value of the specified `rhs` string, propagate to this object the allocator of `rhs` if the `ALLOCATOR` type has trait `propagate_on_container_copy_assignment`, and return a reference providing modifiable access to this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-073.adoc[operator=](xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>] const& rhs); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-073.adoc[_» more..._]# Assign to this string the value of the specified null‐terminated `rhs` string (of length `CHAR_TRAITS::length(characterString)`), and return a reference providing modifiable access to this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-0fa.adoc[operator=](char8_t const* rhs); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-0fa.adoc[_» more..._]# Assign to this string the value of the specified `rhs` object, and return a reference providing modifiable access to this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-0ac.adoc[operator=](STRING_VIEW_LIKE_TYPE const& rhs); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-0ac.adoc[_» more..._]# Assign to this string the value of the specified `rhs` string, and return a reference providing modifiable access to this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOC2> xref:bsl/basic_string-0faf.adoc[basic_string<char8_t>]& xref:bsl/basic_string-01d/operator_assign-0f3.adoc[operator=](std::basic_string<char8_t, char_traits<char8_t>, ALLOC2> const& rhs); ---- [.small]#xref:bsl/basic_string-01d/operator_assign-0f3.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#