[#bsl-basic_string-0ce-2constructor-055]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0ce.adoc[basic&lowbar;string&lt;char16&lowbar;t&gt;]::basic&lowbar;string
:relfileprefix: ../../
:mrdocs:

Create a string that has the same value as the specified `strRef` string&period; The resulting string will contain the same sequence of characters as `strRef`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, then a default&hyphen;constructed allocator is used&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
basic&lowbar;string(
    xref:BloombergLP/bslstl/StringRefData-04.adoc[BloombergLP::bslstl::StringRefData&lt;char16&lowbar;t&gt;] const& strRef,
    xref:bsl/allocator-0df.adoc[allocator&lt;char16&lowbar;t&gt;] const& basicAllocator = ALLOCATOR());
----


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