std::ostream (3) - Linux Manuals
std::ostream: std::basic_ostream
NAME
std::basic_ostream - std::basic_ostream
Synopsis
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 the interface provided by the basic_streambuf class, accessed through the basic_ios base class. In typical implementations, basic_ostream has no non-inherited data members.
std-basic ostream-inheritance.svg
Inheritance diagram
Two specializations for common character types are also defined:
Defined in header <ostream>
Type Definition
ostream basic_ostream<char>
wostream basic_ostream<wchar_t>
Global objects
Six global basic_ostream objects are provided by the standard library.
Defined in header <iostream>
cout (global object)
wcout
cerr (global object)
wcerr
clog (global object)
wclog
Member types
Member type Definition
char_type CharT
traits_type Traits; the program is ill-formed if Traits::char_type is not CharT.
int_type Traits::int_type
pos_type Traits::pos_type
off_type Traits::off_type
Member functions
constructor (public member function)
destructor destructs the object
[virtual]
operator= move-assigns from another basic_ostream
(C++11)
Formatted output
operator<< (public member function)
Unformatted output
put (public member function)
write (public member function)
Positioning
tellp (public member function)
seekp (public member function)
Miscellaneous
flush (public member function)
swap swaps stream objects, except for the associated buffer
(C++11)
Member classes
sentry (public member class)
Non-member functions
operator<<(std::basic_ostream) (function template)
Inherited from std::basic_ios
Member types
Member type Definition
char_type CharT
traits_type Traits
int_type Traits::int_type
pos_type Traits::pos_type
off_type Traits::off_type
Member functions
State functions
good (public member function of std::basic_ios<CharT,Traits>)
eof (public member function of std::basic_ios<CharT,Traits>)
fail (public member function of std::basic_ios<CharT,Traits>)
bad (public member function of std::basic_ios<CharT,Traits>)