std::basic_ostream::swap

protected: void swap(basic_ostream& rhs); (since C++11) Calls basic_ios::swap(rhs) to swap all data members of the base class, except for rdbuf(), between *this and rhs. This swap function is protected: it is called by the swap functions of the swappable output stream classes std::basic_ofstream and std::basic_ostringstream, which know how to correctly swap the associated streambuffers. Parameters rhs - a basic_ostream of the same type to swap with Example #include &

std::basic_ostream::sentry

class sentry; An object of class basic_ostream::sentry is constructed in local scope at the beginning of each member function of std::basic_ostream that performs output (both formatted and unformatted). Its constructor prepares the output stream: checks if the stream is already in a failed state, flushes the tie()'d output streams, and performs other implementation-defined tasks if necessary. Implementation-defined cleanup, as well as flushing of the output stream if necessary, is perfo

std::basic_ostream::seekp

basic_ostream& seekp( pos_type pos ); (1) basic_ostream& seekp( off_type off, std::ios_base::seekdir dir); (2) Sets the output position indicator of the current associated streambuf object. Behaves as UnformattedOutputFunction (except without actually performing output). After constructing and checking the sentry object, (since C++11) 1) sets the output position indicator to absolute (relative to the beginning of the file) value pos by calling rdbuf()->pubseekpos(p

std::basic_ostream::put

basic_ostream& put( char_type ch ); Behaves as an UnformattedOutputFunction. After constructing and checking the sentry object, writes the character ch to the output stream. If the output fails for any reason, sets badbit. Parameters ch - character to write Return value *this. Notes This function is not overloaded for the types signed char or unsigned char, unlike the formatted operator<< Unlike formatted output functions, this function does not set the failbi

std::basic_ostream::operator&lt;&lt;

basic_ostream& operator<<( short value ); basic_ostream& operator<<( unsigned short value ); (1) basic_ostream& operator<<( int value ); basic_ostream& operator<<( unsigned int value ); (2) basic_ostream& operator<<( long value ); basic_ostream& operator<<( unsigned long value ); (3) basic_ostream& operator<<( long long value ); basic_ostream& operator<<( unsigned long long value ); (4) (since

std::basic_ostream::flush

basic_ostream& flush(); Writes uncommitted changes to the underlying output sequence. If rdbuf() is a null pointer, does nothing. Otherwise, behaves as an UnformattedOutputFunction (since C++11). After constructing and checking the sentry object, calls rdbuf()->pubsync(). If the call returns -1, calls setstate(badbit). Parameters (none). Return value *this. Exceptions May throw std::ios_base::failure if exceptions()&badbit!=0. Example #include <thread> #in

std::basic_ostream::basic_ostream

explicit basic_ostream( std::basic_streambuf<CharT, Traits>* sb ); (1) protected: basic_ostream( const basic_ostream& rhs ) = delete; (2) (since C++11) protected: basic_ostream( basic_ostream&& rhs ); (3) (since C++11) 1) Constructs the basic_ostream object, assigning initial values to the base class by calling basic_ios::init(sb). 2) The copy constructor is protected, and is deleted. Output streams are not copyable. 3) The move constructor uses basic_ios&l

std::basic_ostream

Defined in header <ostream> template< class CharT, class Traits = std::char_traits<CharT> > class basic_ostream : virtual public std::basic_ios<CharT, Traits> The class template basic_ostream provides support for high level output operations on character streams. The supported operations include formatted output (e.g. integer values) and unformatted output (e.g. raw characters and character arrays). This functionality is implemented in terms of t

std::basic_ofstream::swap

void swap( basic_ofstream& other ); (since C++11) Exchanges the state of the stream with those of other. This is done by calling basic_ostream<CharT, Traits>::swap(other) and rdbuf()->swap(other.rdbuf()). Parameters other - stream to exchange the state with Return value (none). Example See also operator= (C++11) moves the file stream (public member function) swap (C++11) swaps two basic_filebuf objects (public member function of std::basic_

std::basic_ofstream::rdbuf

std::basic_filebuf<CharT, Traits>* rdbuf() const; (since C++11) Returns pointer to the underlying raw file device object. Parameters (none). Return value Pointer to the underlying raw file device. Example