#include <locale>
-namespace std
+namespace std
{
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>::sentry::
__os.setstate(ios_base::failbit);
}
}
-
+
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__ostream_type& (*__pf)(__ostream_type&))
{
// The inserters for manipulators are *not* formatted output functions.
return __pf(*this);
}
-
+
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__ios_type& (*__pf)(__ios_type&))
{
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(ios_base& (*__pf)(ios_base&))
{
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(bool __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(long __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
bool __b = false;
char_type __c = this->fill();
}
else
__b = __np.put(*this, *this, __c, __n).failed();
- if (__b)
+ if (__b)
__err |= ios_base::badbit;
}
catch(...)
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(unsigned long __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(long long __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
bool __b = false;
char_type __c = this->fill();
}
else
__b = __np.put(*this, *this, __c, __n).failed();
- if (__b)
+ if (__b)
__err |= ios_base::badbit;
}
catch(...)
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(unsigned long long __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
return *this;
}
#endif
-
+
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(double __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
}
return *this;
}
-
+
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(long double __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(const void* __n)
{
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
- try
+ try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
}
template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
operator<<(__streambuf_type* __sbin)
{
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
put(char_type __c)
- {
+ {
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 60. What is a formatted input function?
// basic_ostream::put(char_type) is an unformatted output function.
// Unformatted output functions should catch exceptions thrown
// from streambuf members.
sentry __cerb(*this);
- if (__cerb)
+ if (__cerb)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- int_type __put = this->rdbuf()->sputc(__c);
+ int_type __put = this->rdbuf()->sputc(__c);
if (traits_type::eq_int_type(__put, traits_type::eof()))
__err |= ios_base::badbit;
}
if (__err)
this->setstate(__err);
}
- return *this;
+ return *this;
}
template<typename _CharT, typename _Traits>
this->setstate(__err);
return *this;
}
-
+
template<typename _CharT, typename _Traits>
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::out);
-
+
// 129. Need error indication from seekp() and seekg()
if (__p == pos_type(off_type(-1)))
__err |= ios_base::failbit;
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
- pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
ios_base::out);
-
+
// 129. Need error indication from seekp() and seekg()
if (__p == pos_type(off_type(-1)))
__err |= ios_base::failbit;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
- try
+ try
{
const streamsize __w = __out.width();
streamsize __len = 1;
{
__cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
- __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
+ __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
&__c, __w, __len, false);
__len = __w;
}
}
return __out;
}
-
+
// Specializations.
- template <class _Traits>
+ template <class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __out, char __c)
{
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
{
- try
+ try
{
const streamsize __w = __out.width();
streamsize __len = 1;
if (__w > __len)
{
__cs = static_cast<char*>(__builtin_alloca(__w));
- __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
+ __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
&__c, __w, __len, false);
__len = __w;
}
typename __ostream_type::sentry __cerb(__out);
if (__cerb && __s)
{
- try
+ try
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
{
_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
- __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
+ __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__s, __w, __len, false);
__s = __cs;
__len = __w;
for (size_t __i = 0; __i < __clen; ++__i)
__ws[__i] = __out.widen(__s[__i]);
_CharT* __str = __ws;
-
- try
+
+ try
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(__clen);
{
_CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __w));
- __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
+ __pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs,
__ws, __w, __len, false);
__str = __cs;
__len = __w;
typename __ostream_type::sentry __cerb(__out);
if (__cerb && __s)
{
- try
+ try
{
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(_Traits::length(__s));
if (__w > __len)
{
char* __cs = static_cast<char*>(__builtin_alloca(__w));
- __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
+ __pad<char, _Traits>::_S_pad(__out, __out.fill(), __cs,
__s, __w, __len, false);
__s = __cs;
__len = __w;
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __out,
const basic_string<_CharT, _Traits, _Alloc>& __str)
- {
+ {
typedef basic_ostream<_CharT, _Traits> __ostream_type;
typename __ostream_type::sentry __cerb(__out);
if (__cerb)
}
// Inhibit implicit instantiations for required instantiations,
- // which are defined via explicit instantiations elsewhere.
+ // which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ostream<char>;