[#bsl-basic_string-0faf-2constructor-05c]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]::basic&lowbar;string
:relfileprefix: ../../
:mrdocs:

Create a `basic&lowbar;string` object&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
basic&lowbar;string(
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;basic&lowbar;string&gt;] original,
    ALLOCATOR const& basicAllocator);
----

== Description

Create a string that has the same value as the specified `original` string that uses the specified `basicAllocator` to supply memory&period; The contents of `original` are moved (in constant time) to the new string if `basicAllocator &equals;&equals; original&period;get&lowbar;allocator()`, and are copied (in linear time) using `basicAllocator` otherwise&period; `original` is left in a valid but unspecified state&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| source string
| *basicAllocator*
| allocator used to supply memory
|===


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