[#bsl-basic_string-0faf-2constructor-0c0]
= 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"]
----
template&lt;class ALLOC2&gt;
basic&lowbar;string(
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt; const& original,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

== Description

Create a string that has the same value as the specified `original` string, where the type `original` is the string type native to the compiler&apos;s library, instantiated with the same character type and traits type, but not necessarily the same allocator type&period; The resulting string will contain the same sequence of characters as `original`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, then a default&hyphen;constructed allocator is used&period;

== Parameters

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


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