Create a basic_stringstream from a string with a different allocator.

Synopsis

Declared in <bslstl_stringstream.h>

template<class SALLOC>
explicit
basic_stringstream(
    bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, SALLOC> const& initialString,
    allocator_type const& allocator = allocator_type())
requires !bsl::is_same<ALLOCATOR, SALLOC>::value;

Description

Use the specified initialString indicating the initial sequence of characters that this stream will access or manipulate. rdbuf is created using ios_base::in | ios_base::out. Optionally specify the allocator used to supply memory. If allocator is not supplied, a default‐constructed object of the (template parameter) ALLOCATOR type is used. If the ALLOCATOR argument is of type bsl::allocator (the default), then allocator, if supplied, shall be convertible to bslma::Allocator *. If the ALLOCATOR argument is of type bsl::allocator and allocator is not supplied, the currently installed default allocator will be used to supply memory.

Parameters

Name

Description

initialString

initial character sequence for the stream

allocator

allocator used to supply memory

Created with MrDocs