Create a basic_string object.

Synopsis

Declared in <bslstl_string.h>

basic_string(
    basic_string const& original,
    size_type position,
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Description

Create a string that has the same value as the substring of the specified numChars length starting at the specified position in the specified original string. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default‐constructed allocator is used. Throw out_of_range if position > original.length().

Parameters

Name

Description

original

source string

position

starting index

basicAllocator

allocator used to supply memory

Created with MrDocs