[#BloombergLP-bslstl-StringRefImp-0a-assign-000]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp-0a.adoc[StringRefImp&lt;wchar&lowbar;t&gt;]::assign
:relfileprefix: ../../../
:mrdocs:

`assign` overloads

== Synopses

Declared in `&lt;bslstl&lowbar;stringref&period;h&gt;`

Modify this string reference to refer to the same string as the specified `stringRef`&period; Note, that the string bound to `stringRef` must remain valid as long as it is bound to this object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslstl/StringRefImp-0a/assign-037.adoc[assign](xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp&lt;wchar&lowbar;t&gt;] const& stringRef);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0a/assign-037.adoc[_» more&period;&period;&period;_]#

Bind this string reference to the specified `str` string&period; The string indicated by `str` must remain valid as long as it is bound to this object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslstl/StringRefImp-0a/assign-02.adoc[assign](xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;wchar&lowbar;t&gt;] const& str);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0a/assign-02.adoc[_» more&period;&period;&period;_]#

Bind this string reference to the string at the specified `data` address and extending for `std&colon;&colon;char&lowbar;traits&lt;CHAR&lowbar;TYPE&gt;&colon;&colon;length(data)` characters&period; The string at the `data` address must remain valid as long as it is bound to this string reference&period; The behavior is undefined unless `data` is null&hyphen;terminated&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslstl/StringRefImp-0a/assign-04.adoc[assign](wchar&lowbar;t const* data);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0a/assign-04.adoc[_» more&period;&period;&period;_]#

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&period; The string indicated by `begin` and `end` must remain valid as long as it is bound to this object&period; The behavior is undefined unless `begin &lt;&equals; end`&period; Note that the string need not be null&hyphen;terminated and may contain embedded null characters&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslstl/StringRefImp-0a/assign-033.adoc[assign](
    xref:BloombergLP/bslstl/StringRefImp-0a/const_iterator.adoc[const&lowbar;iterator] begin,
    xref:BloombergLP/bslstl/StringRefImp-0a/const_iterator.adoc[const&lowbar;iterator] end);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0a/assign-033.adoc[_» more&period;&period;&period;_]#

Assign this ref to the specified `data` of the specified `length`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bslstl/StringRefImp-0a/assign-009.adoc[assign](
    wchar&lowbar;t const* data,
    xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size&lowbar;type] length);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0a/assign-009.adoc[_» more&period;&period;&period;_]#

Bind this string reference to the string at the specified `data` address and extending for the specified `length` characters&period; The string indicated by `data` and `length` must remain valid as long as it is bound to this object&period; The behavior is undefined unless `0 &lt;&equals; length` or `0 &equals;&equals; data &amp;&amp; 0 &equals;&equals; length`&period; Note that the string need not be null&hyphen;terminated and may contain embedded null characters&period; Note that the template and non&hyphen;template versions combine to allow various integral and enumeration types to be used for length while preventing `(char &ast;, 0)` initializer arguments from matching the two&hyphen;iterator overload of `assign` below&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INT&lowbar;TYPE&gt;
void
xref:BloombergLP/bslstl/StringRefImp-0a/assign-09.adoc[assign](
    wchar&lowbar;t const* data,
    INT&lowbar;TYPE length)
requires bsl&colon;&colon;is&lowbar;integral&lt;INT&lowbar;TYPE&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0a/assign-09.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
