bsl::basic_string::basic_string

Create a basic_string object.

Synopsis

Declared in <bslstl_string.h>

template<class ALLOC2>
basic_string(
    std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> 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's library, instantiated with the same character type and traits type, but not necessarily the same allocator type. The resulting string will contain the same sequence of characters as original. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, then a default-constructed allocator is used.

Parameters

NameDescription
originalsource string
basicAllocatorallocator used to supply memory