namespace std { template <class charT, class traits = char_traits<charT>> class basic_ostream : virtual public basic_ios<charT, traits> { public: // types (inherited from basic_ios ([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; // [ostream.cons], constructor/destructor explicit basic_ostream(basic_streambuf<char_type, traits>* sb); virtual ~basic_ostream(); // [ostream::sentry], prefix/suffix class sentry; // [ostream.formatted], formatted output basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& (*pf)(basic_ostream<charT, traits>&)); basic_ostream<charT, traits>& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&)); basic_ostream<charT, traits>& operator<<(ios_base& (*pf)(ios_base&)); basic_ostream<charT, traits>& operator<<(bool n); basic_ostream<charT, traits>& operator<<(short n); basic_ostream<charT, traits>& operator<<(unsigned short n); basic_ostream<charT, traits>& operator<<(int n); basic_ostream<charT, traits>& operator<<(unsigned int n); basic_ostream<charT, traits>& operator<<(long n); basic_ostream<charT, traits>& operator<<(unsigned long n); basic_ostream<charT, traits>& operator<<(long long n); basic_ostream<charT, traits>& operator<<(unsigned long long n); basic_ostream<charT, traits>& operator<<(float f); basic_ostream<charT, traits>& operator<<(double f); basic_ostream<charT, traits>& operator<<(long double f); basic_ostream<charT, traits>& operator<<(const void* p); basic_ostream<charT, traits>& operator<<(nullptr_t); basic_ostream<charT, traits>& operator<<(basic_streambuf<char_type, traits>* sb); // [ostream.unformatted], unformatted output basic_ostream<charT, traits>& put(char_type c); basic_ostream<charT, traits>& write(const char_type* s, streamsize n); basic_ostream<charT, traits>& flush(); // [ostream.seeks], seeks pos_type tellp(); basic_ostream<charT, traits>& seekp(pos_type); basic_ostream<charT, traits>& seekp(off_type, ios_base::seekdir); protected: // [ostream.cons], copy/move constructor basic_ostream(const basic_ostream& rhs) = delete; basic_ostream(basic_ostream&& rhs); // [ostream.assign], assign and swap basic_ostream& operator=(const basic_ostream& rhs) = delete; basic_ostream& operator=(basic_ostream&& rhs); void swap(basic_ostream& rhs); }; // [ostream.inserters.character], character inserters template<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>&, signed char); template<class traits> basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, unsigned char); 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>&, const char*); template<class traits> basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, const char*); template<class traits> basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, const signed char*); template<class traits> basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, const unsigned char*); }
explicit basic_ostream(basic_streambuf<charT, traits>* sb);
basic_ostream(basic_ostream&& rhs);
virtual ~basic_ostream();
basic_ostream& operator=(basic_ostream&& rhs);
void swap(basic_ostream& rhs);
namespace std {
template <class charT, class traits = char_traits<charT>>
class basic_ostream<charT, traits>::sentry {
bool ok_; // exposition only
public:
explicit sentry(basic_ostream<charT, traits>& os);
~sentry();
explicit operator bool() const { return ok_; }
sentry(const sentry&) = delete;
sentry& operator=(const sentry&) = delete;
};
}
explicit sentry(basic_ostream<charT, traits>& os);
~sentry();
explicit operator bool() const;
pos_type tellp();
basic_ostream<charT, traits>& seekp(pos_type pos);
basic_ostream<charT, traits>& seekp(off_type off, ios_base::seekdir dir);
operator<<(bool val);
operator<<(short val);
operator<<(unsigned short val);
operator<<(int val);
operator<<(unsigned int val);
operator<<(long val);
operator<<(unsigned long val);
operator<<(long long val);
operator<<(unsigned long long val);
operator<<(float val);
operator<<(double val);
operator<<(long double val);
operator<<(const void* val);
bool failed = use_facet< num_put<charT, ostreambuf_iterator<charT, traits>> >(getloc()).put(*this, *this, fill(), val).failed();When val is of type short the formatting conversion occurs as if it performed the following code fragment:
ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield; bool failed = use_facet< num_put<charT, ostreambuf_iterator<charT, traits>> >(getloc()).put(*this, *this, fill(), baseflags == ios_base::oct || baseflags == ios_base::hex ? static_cast<long>(static_cast<unsigned short>(val)) : static_cast<long>(val)).failed();When val is of type int the formatting conversion occurs as if it performed the following code fragment:
ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield; bool failed = use_facet< num_put<charT, ostreambuf_iterator<charT, traits>> >(getloc()).put(*this, *this, fill(), baseflags == ios_base::oct || baseflags == ios_base::hex ? static_cast<long>(static_cast<unsigned int>(val)) : static_cast<long>(val)).failed();When val is of type unsigned short or unsigned int the formatting conversion occurs as if it performed the following code fragment:
bool failed = use_facet< num_put<charT, ostreambuf_iterator<charT, traits>> >(getloc()).put(*this, *this, fill(), static_cast<unsigned long>(val)).failed();When val is of type float the formatting conversion occurs as if it performed the following code fragment:
bool failed = use_facet< num_put<charT, ostreambuf_iterator<charT, traits>> >(getloc()).put(*this, *this, fill(), static_cast<double>(val)).failed();
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& (*pf)(basic_ostream<charT, traits>&));
basic_ostream<charT, traits>&
operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
basic_ostream<charT, traits>& operator<<(ios_base& (*pf)(ios_base&));
basic_ostream<charT, traits>& operator<<(basic_streambuf<charT, traits>* sb);
basic_ostream<charT, traits>& operator<<(nullptr_t);
return *this << s;where s is an implementation-defined NTCTS ([defns.ntcts]).
template<class charT, class traits>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, charT c);
template<class charT, class traits>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, char c);
// specialization
template<class traits>
basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, char c);
// signed and unsigned
template<class traits>
basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, signed char c);
template<class traits>
basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, unsigned char c);
template<class charT, class traits>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const charT* s);
template<class charT, class traits>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const char* s);
template<class traits>
basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const char* s);
template<class traits>
basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const signed char* s);
template<class traits>
basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out,
const unsigned char* s);
basic_ostream<charT, traits>& put(char_type c);
basic_ostream& write(const char_type* s, streamsize n);
basic_ostream& flush();
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, class T>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&& os, const T& x);