This header is part of theInput/output library.
Classes | ||
wraps a given abstract device (std::basic_streambuf) and provides high-level output interface (class template)[edit] | ||
std::ostream | std::basic_ostream<char> (typedef) | |
std::wostream | std::basic_ostream<wchar_t> (typedef) | |
Functions | ||
inserts character data or insert into rvalue stream (function template)[edit] | ||
(C++23) | outputsformatted representation of the arguments (function template)[edit] | |
(C++23) | outputsformatted representation of the arguments with appended'\n' (function template)[edit] | |
(C++23) | performs Unicode aware output usingtype-erased argument representation (function)[edit] | |
outputs character data usingtype-erased argument representation (function)[edit] | ||
Manipulators | ||
outputs'\n' and flushes the output stream (function template)[edit] | ||
outputs'\0' (function template)[edit] | ||
flushes the output stream (function template)[edit] | ||
(C++20) | controls whether a stream'sbasic_syncbuf emits on flush (function template)[edit] | |
(C++20) | flushes a stream and emits the content if it is using abasic_syncbuf (function template)[edit] |
namespace std{template<class CharT,class Traits= char_traits<CharT>>class basic_ostream; using ostream= basic_ostream<char>;using wostream= basic_ostream<wchar_t>; template<class CharT,class Traits> basic_ostream<CharT, Traits>& endl(basic_ostream<CharT, Traits>& os);template<class CharT,class Traits> basic_ostream<CharT, Traits>& ends(basic_ostream<CharT, Traits>& os);template<class CharT,class Traits> basic_ostream<CharT, Traits>& flush(basic_ostream<CharT, Traits>& os); template<class CharT,class Traits> basic_ostream<CharT, Traits>& emit_on_flush(basic_ostream<CharT, Traits>& os);template<class CharT,class Traits> basic_ostream<CharT, Traits>& noemit_on_flush(basic_ostream<CharT, Traits>& os);template<class CharT,class Traits> basic_ostream<CharT, Traits>& flush_emit(basic_ostream<CharT, Traits>& os); template<class Ostream,class T> Ostream&& operator<<(Ostream&& os,const T& x); // print functionstemplate<class...Args>void print(ostream& os, format_string<Args...> fmt, Args&&...args);template<class...Args>void println(ostream& os, format_string<Args...> fmt, Args&&...args);void println(ostream& os); void vprint_unicode(ostream& os, string_view fmt, format_args args);void vprint_nonunicode(ostream& os, string_view fmt, format_args args);}
namespace std{template<class CharT,class Traits= char_traits<CharT>>class basic_ostream:virtualpublic basic_ios<CharT, Traits>{public:// types (inherited from basic_ios)using char_type= CharT;using int_type=typename Traits::int_type;using pos_type=typename Traits::pos_type;using off_type=typename Traits::off_type;using traits_type= Traits; // constructor/destructorexplicit basic_ostream(basic_streambuf<char_type, Traits>* sb);virtual ~basic_ostream(); // prefix/suffixclass sentry; // formatted output basic_ostream& operator<<(basic_ostream&(*pf)(basic_ostream&)); basic_ostream& operator<<(basic_ios<CharT, Traits>&(*pf)(basic_ios<CharT, Traits>&)); basic_ostream& operator<<(ios_base&(*pf)(ios_base&)); basic_ostream& operator<<(bool n); basic_ostream& operator<<(short n); basic_ostream& operator<<(unsignedshort n); basic_ostream& operator<<(int n); basic_ostream& operator<<(unsignedint n); basic_ostream& operator<<(long n); basic_ostream& operator<<(unsignedlong n); basic_ostream& operator<<(longlong n); basic_ostream& operator<<(unsignedlonglong n); basic_ostream& operator<<(float f); basic_ostream& operator<<(double f); basic_ostream& operator<<(longdouble f); basic_ostream& operator<<(/*extended-floating-point-type*/ f); basic_ostream& operator<<(constvoid* p); basic_ostream& operator<<(constvolatilevoid* p); basic_ostream& operator<<(nullptr_t); basic_ostream& operator<<(basic_streambuf<char_type, Traits>* sb); // unformatted output basic_ostream& put(char_type c); basic_ostream& write(const char_type* s, streamsize n); basic_ostream& flush(); // seeks pos_type tellp(); basic_ostream& seekp(pos_type); basic_ostream& seekp(off_type, ios_base::seekdir); protected:// copy/move constructor basic_ostream(const basic_ostream&)= delete; basic_ostream(basic_ostream&& rhs); // assignment and swap basic_ostream& operator=(const basic_ostream&)= delete; basic_ostream& operator=(basic_ostream&& rhs);void swap(basic_ostream& rhs);}; // character inserterstemplate<class CharT,class Traits> basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>&, CharT);template<class CharT,class Traits> basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>&,char);template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,char); template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,signedchar);template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,unsignedchar); template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,wchar_t)= delete;template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&, char8_t)= delete;template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,char16_t)= delete;template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,char32_t)= delete;template<class Traits> basic_ostream<wchar_t, Traits>& operator<<(basic_ostream<wchar_t, Traits>&, char8_t)= delete;template<class Traits> basic_ostream<wchar_t, Traits>& operator<<(basic_ostream<wchar_t, Traits>&,char16_t)= delete;template<class Traits> basic_ostream<wchar_t, Traits>& operator<<(basic_ostream<wchar_t, Traits>&,char32_t)= delete; template<class CharT,class Traits> basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>&,const CharT*);template<class CharT,class Traits> basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>&,constchar*);template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,constchar*); template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,constsignedchar*);template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,constunsignedchar*); template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,constwchar_t*)= delete;template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,const char8_t*)= delete;template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,constchar16_t*)= delete;template<class Traits> basic_ostream<char, Traits>& operator<<(basic_ostream<char, Traits>&,constchar32_t*)= delete;template<class Traits> basic_ostream<wchar_t, Traits>& operator<<(basic_ostream<wchar_t, Traits>&,const char8_t*)= delete;template<class Traits> basic_ostream<wchar_t, Traits>& operator<<(basic_ostream<wchar_t, Traits>&,constchar16_t*)= delete;template<class Traits> basic_ostream<wchar_t, Traits>& operator<<(basic_ostream<wchar_t, Traits>&,constchar32_t*)= delete;}
namespace std{template<class CharT,class Traits>class basic_ostream<CharT, Traits>::sentry{bool ok_;// exposition onlypublic:explicit sentry(basic_ostream& os); ~sentry();explicit operatorbool()const{return ok_;} sentry(const sentry&)= delete; sentry& operator=(const sentry&)= delete;};}