bsl::basic_string::basic_string

Create a string filled with copies of a character.

Synopsis

Declared in <bslstl_string.h>

template<>
requires bsl::IsStdAllocator<ALLOCATOR>::value
basic_string(
    size_type numChars,
    CHAR_TYPE character,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Description

Create a string of the specified numChars length whose every position contains the specified character. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used.

Parameters

NameDescription
numCharsnumber of characters
charactercharacter value used to fill the string
basicAllocatorallocator used to supply memory