bsl::basic_ostringstream

This class implements a standard output stream that provides an accessor for obtaining a bsl::basic_string containing the sequence of characters that have been written to the stream.

Synopsis

Declared in <bslstl_ostringstream.h>

template<
    class CHAR_TYPE,
    class CHAR_TRAITS = char_traits<CHAR_TYPE>,
    class ALLOCATOR = allocator<CHAR_TYPE>>
class basic_ostringstream
    : public std::basic_ostream<CHAR_TYPE, CHAR_TRAITS>

Base Classes

NameDescription
std::basic_ostream<CHAR_TYPE, CHAR_TRAITS>Template class basic_ostream.

Types

NameDescription
sentry Performs setup work for output streams.

Type Aliases

NameDescription
allocator_type This typedef is an alias to the (template parameter) ALLOCATOR.
char_type This typedef is an alias to the (template parameter) CHAR_TYPE.
int_type This typedef is an alias to traits_type::int_type.
off_type This typedef is an alias to traits_type::off_type.
pos_type This typedef is an alias to traits_type::pos_type.
traits_type This typedef is an alias to the (template parameter) CHAR_TRAITS.

Member Functions

NameDescription
basic_ostringstream [constructor]Constructors
operator= Assign to this object the value of the specified rhs, and return a reference providing modifiable access to this object. The contents of rhs are move-assigned to this object. rhs is left in a valid but unspecified state.
get_allocator Return the allocator used by the underlying buffer to supply memory.
rdbuf Return an address providing modifiable access to the basic_stringbuf object that is internally used by this string stream to buffer unformatted characters.
str str overloads
swap Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee if *this and other allocators compare equal. The behavior is undefined unless either *this and other allocators compare equal or propagate_on_container_swap is true. Note that this function is only available for C++11 (and later) language standards because it requires that swap be provided on the (platform supplied) base class for this type.
view Return a view of the internally buffered sequence of characters maintained by this stream object.

Non-Member Functions

NameDescription
swapEfficiently exchange the values of the specified a and b objects. This method provides the no-throw exception-safety guarantee if a and b allocators compare equal. Note that this function is only available for C++11 (and later) language standards.