std::out_of_range

Defined in header <stdexcept> class out_of_range; Defines a type of object to be thrown as exception. It reports errors that are consequence of attempt to access elements out of defined range. It may be thrown by the member functions of std::bitset and std::basic_string, by std::stoi and std::stod families of functions, and by the bounds-checked member access functions (e.g. std::vector::at and std::map::at). Inheritance diagram. Member functions (constructor)

std::ostrstream::str

char* str(); Returns the pointer to the beginning of the buffer, after freezing it. Effectively calls rdbuf()->str(). Notes After a call to str(), dynamic streams become frozen. A call to freeze(false) is required before exiting the scope in which this ostrstream object was created. otherwise the destructor will leak memory. Also, additional output to a frozen stream may be truncated once it reaches the end of the allocated buffer. Parameters (none). Return value Pointer to t

std::ostrstream::rdbuf

strstreambuf* rdbuf() const; Returns a pointer to the associated std::strstreambuf, casting away its constness (despite the const qualifier on the member function). Parameters (none). Return value Pointer to the associated std::strsteambuf, with constness cast away. Example #include <strstream> int main() { const std::ostrstream buf; std::strstreambuf* ptr = buf.rdbuf(); }

std::ostrstream::pcount

int pcount() const; Returns the number of characters that were output in the put area of the associated std::strstreambuf. Effectively calls rdbuf()->pcount(). Parameters (none). Return value The number of characters in the put area, or zero if nothing was output. Example #include <strstream> #include <iostream> int main() { std::ostrstream dyn; // dynamically-allocated output buffer dyn << "Test: " << 1.23; std::cout << "The siz

std::ostrstream::ostrstream

ostrstream(); (1) ostrstream(char* s, int n, std::ios_base::openmode mode = std::ios_base::out); (2) Constructs new output strstream and its underlying std::strstreambuf. 1) Default-constructs the underlying std::strstreambuf, which creates a dynamically growing buffer, and initializes the base class with the address of the strstreambuf member. 2) Initialized the base class with the address of the underlying std::strstreambuf member, which is initialized in one of the two possib

std::ostrstream::freeze

void freeze(bool flag = true); If the stream is using a dynamically-allocated array for output, disables (flag == true) or enables (flag == false) automatic allocation/deallocation of the buffer. Effectively calls rdbuf()->freeze(flag). Notes After a call to str(), dynamic streams become frozen automatically. A call to freeze(false) is required before exiting the scope in which this ostrstream object was created. otherwise the destructor will leak memory. Also, additional output t

std::ostrstream

Defined in header <strstream> class ostrstream : public std::ostream (deprecated) The class ostrstream implements output operations on array-backed streams. It essentially wraps a raw array I/O device implementation (std::strstreambuf) into the higher-level interface of std::basic_ostream. The typical implementation of ostrstream holds only one non-derived data member: an object of type std::strstreambuf. Notes After any call to str(), a call to freeze(false) is required

std::ostream_iterator::ostream_iterator

ostream_iterator(ostream_type& stream, const CharT* delim) (1) ostream_iterator(ostream_type& stream) (2) 1) Constructs the iterator with the private ostream_type* member initialized with &stream and the private delimiter pointer initialized with delim. 2) Constructs the iterator with the private ostream_type* member initialized with &stream and the private delimiter pointer initialized with null pointer value. Parameters stream - the output stream to be ac

std::ostream_iterator::operator++

ostream_iterator& operator++(); ostream_iterator& operator++( int ); Does nothing. These operator overloads are provided to satisfy the requirements of OutputIterator. They make it possible for the expressions *iter++=value and *++iter=value to be used to output (insert) a value into the underlying stream. Parameters (none). Return value *this.

std::ostream_iterator

Defined in header <iterator> template< class T, class CharT = char, class Traits = std::char_traits<CharT> > class ostream_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void> (until C++17) template< class T, class CharT = char, class Traits = std::char_traits<CharT>> class ostream_iterator; (since C++17) std::ostream_iterato