Megosztás a következőn keresztül:


basic_ostringstream Class

Describes an object that controls insertion of elements and encoded objects into a stream buffer of class basic_stringbuf<Elem, Tr, Alloc>.

template < 
   class Elem,  
   class Tr = char_traits<Elem>,  
   class Alloc = allocator<Elem>  
> 
   class basic_ostringstream : public basic_ostream<Elem, Tr>

Parameters

  • Alloc
    The allocator class.

  • Elem
    The type of the basic element of the string.

  • Tr
    The character traits specialized on the basic element of the string.

Remarks

The class describes an object that controls insertion of elements and encoded objects into a stream buffer, with elements of type Elem, whose character traits are determined by the class Tr, and whose elements are allocated by an allocator of class Alloc. The object stores an object of class basic_stringbuf<Elem, Tr, Alloc>.

Constructors

basic_ostringstream

Constructs an object of type basic_ostringstream.

Typedefs

allocator_type

The type is a synonym for the template parameter Alloc.

Member Functions

rdbuf

Returns the address of the stored stream buffer of type pointer to basic_stringbuf<Elem, Tr, Alloc>.

str

Sets or gets the text in a string buffer without changing the write position.

Requirements

Header: <sstream>

Namespace: std

See Also

Reference

Thread Safety in the C++ Standard Library

iostream Programming

iostreams Conventions