Create a basic_string object.
Declared in <bslstl_string.h>
template<class STRING_VIEW_LIKE_TYPE>
basic_string(
STRING_VIEW_LIKE_TYPE const& object,
size_type position,
size_type numChars,
ALLOCATOR const& basicAllocator = ALLOCATOR());
Create a string that has the same value as the substring of the specified numChars length starting at the specified position in the specified object. Optionally specify a basicAllocator used to supply memory. If the basicAllocator is not specified, a default-constructed allocator is used. Throw out_of_range if position > original.object().
| Name | Description |
|---|---|
| object | source object providing characters |
| position | starting index |
| numChars | number of characters |
| basicAllocator | allocator used to supply memory |