[#BloombergLP-bslstl-StringRefImp-0c-assign-0d] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp]::assign :relfileprefix: ../../../ :mrdocs: `assign` overloads == Synopses Declared in `<bslstl_stringref.h>` Modify this string reference to refer to the same string as the specified `stringRef`. Note, that the string bound to `stringRef` must remain valid as long as it is bound to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslstl/StringRefImp-0c/assign-0f.adoc[assign](xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp<CHAR_TYPE>] const& stringRef); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/assign-0f.adoc[_» more..._]# Bind this string reference to the specified `str` string. The string indicated by `str` must remain valid as long as it is bound to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslstl/StringRefImp-0c/assign-06.adoc[assign](xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE>] const& str); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/assign-06.adoc[_» more..._]# Bind this string reference to the string at the specified `data` address and extending for `std::char_traits<CHAR_TYPE>::length(data)` characters. The string at the `data` address must remain valid as long as it is bound to this string reference. The behavior is undefined unless `data` is null‐terminated. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslstl/StringRefImp-0c/assign-023.adoc[assign](CHAR_TYPE const* data); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/assign-023.adoc[_» more..._]# Bind this string reference to the string at the specified `begin` iterator, extending up to, but not including, the character at the specified `end` iterator. The string indicated by `begin` and `end` must remain valid as long as it is bound to this object. The behavior is undefined unless `begin <= end`. Note that the string need not be null‐terminated and may contain embedded null characters. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslstl/StringRefImp-0c/assign-09.adoc[assign]( xref:BloombergLP/bslstl/StringRefImp-0c/const_iterator.adoc[const_iterator] begin, xref:BloombergLP/bslstl/StringRefImp-0c/const_iterator.adoc[const_iterator] end); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/assign-09.adoc[_» more..._]# Assign this ref to the specified `data` of the specified `length`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:BloombergLP/bslstl/StringRefImp-0c/assign-00.adoc[assign]( CHAR_TYPE const* data, xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size_type] length); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/assign-00.adoc[_» more..._]# Bind this string reference to the string at the specified `data` address and extending for the specified `length` characters. The string indicated by `data` and `length` must remain valid as long as it is bound to this object. The behavior is undefined unless `0 <= length` or `0 == data && 0 == length`. Note that the string need not be null‐terminated and may contain embedded null characters. Note that the template and non‐template versions combine to allow various integral and enumeration types to be used for length while preventing `(char *, 0)` initializer arguments from matching the two‐iterator overload of `assign` below. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INT_TYPE> void xref:BloombergLP/bslstl/StringRefImp-0c/assign-025.adoc[assign]( CHAR_TYPE const* data, INT_TYPE length, xref:BloombergLP/bslmf/Nil.adoc[bslmf::Nil] = bslmf::Nil()) requires bsl::is_integral<INT_TYPE>::value; ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/assign-025.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#