Create a string that has the same value as the specified original string and uses the specified basicAllocator to supply memory.

Synopsis

Declared in <bslstl_string.h>

basic_string(
    basic_string<char16_t> const& original,
    allocator<char16_t> const& basicAllocator);

Description

Note that it is important to have two copy constructors instead of a single: ` basic_string(const basic_string& original, const ALLOCATOR& basicAllocator = ALLOCATOR()); ` When the copy constructor with the default allocator is used, xlC10 gets confused and refuses to use the return value optimization, which then causes extra allocations when returning by value in operator+.

Created with MrDocs