30#ifndef _OSTREAM_INSERT_H
31#define _OSTREAM_INSERT_H 1
34#pragma GCC system_header
41#pragma GCC diagnostic push
42#pragma GCC diagnostic ignored "-Wc++11-extensions"
44namespace std _GLIBCXX_VISIBILITY(default)
46_GLIBCXX_BEGIN_NAMESPACE_VERSION
50 template<
typename _CharT,
typename _Traits>
52 __ostream_write(basic_ostream<_CharT, _Traits>& __out,
55 typedef basic_ostream<_CharT, _Traits> __ostream_type;
56 typedef typename __ostream_type::ios_base __ios_base;
58 const streamsize __put = __out.rdbuf()->sputn(__s, __n);
60 __out.setstate(__ios_base::badbit);
63 template<
typename _CharT,
typename _Traits>
65 __ostream_fill(basic_ostream<_CharT, _Traits>& __out,
streamsize __n)
67 typedef basic_ostream<_CharT, _Traits> __ostream_type;
68 typedef typename __ostream_type::ios_base __ios_base;
70 const _CharT __c = __out.fill();
71 for (; __n > 0; --__n)
73 const typename _Traits::int_type __put = __out.rdbuf()->sputc(__c);
74 if (_Traits::eq_int_type(__put, _Traits::eof()))
76 __out.setstate(__ios_base::badbit);
82 template<
typename _CharT,
typename _Traits>
83 basic_ostream<_CharT, _Traits>&
84 __ostream_insert(basic_ostream<_CharT, _Traits>& __out,
87 typedef basic_ostream<_CharT, _Traits> __ostream_type;
88 typedef typename __ostream_type::ios_base __ios_base;
90 typename __ostream_type::sentry __cerb(__out);
98 const bool __left = ((__out.flags()
99 & __ios_base::adjustfield)
100 == __ios_base::left);
102 __ostream_fill(__out, __w - __n);
104 __ostream_write(__out, __s, __n);
105 if (__left && __out.good())
106 __ostream_fill(__out, __w - __n);
109 __ostream_write(__out, __s, __n);
114 __out._M_setstate(__ios_base::badbit);
115 __throw_exception_again;
118 { __out._M_setstate(__ios_base::badbit); }
125#if _GLIBCXX_EXTERN_TEMPLATE
128#ifdef _GLIBCXX_USE_WCHAR_T
136_GLIBCXX_END_NAMESPACE_VERSION
139#pragma GCC diagnostic pop
basic_ostream< char > ostream
Base class for char output streams.
basic_ostream< wchar_t > wostream
Base class for wchar_t output streams.
ISO C++ entities toplevel namespace is std.
ptrdiff_t streamsize
Integral type for I/O operation counts and buffer sizes.
Thrown as part of forced unwinding.