+2006-01-24 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/25649
+ * include/std/std_istream.h (operator>>(short&), operator>>(int&)):
+ Move out of line...
+ * include/bits/istream.tcc: ... here.
+ * include/std/std_ostream.h (operator<<(short), operator<<(int)):
+ Move out of line...
+ * include/bits/ostream.tcc: ... here.
+
2006-01-24 Ed Smith-Rowland <3dw4rd@verizon.net>
* docs/html/faq/index.html ([5.2]): Mention TR1 and point to
// istream classes -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
+ operator>>(short& __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 118. basic_istream uses nonexistent num_get member functions.
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (numeric_limits<short>::min() <= __l
+ && __l <= numeric_limits<short>::max())
+ __n = __l;
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
+ operator>>(int& __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 118. basic_istream uses nonexistent num_get member functions.
+ long __l;
+ _M_extract(__l);
+ if (!this->fail())
+ {
+ if (numeric_limits<int>::min() <= __l
+ && __l <= numeric_limits<int>::max())
+ __n = __l;
+ else
+ this->setstate(ios_base::failbit);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::
operator>>(__streambuf_type* __sbout)
{
ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
// ostream classes -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
}
return *this;
}
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(short __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(int __n)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 117. basic_ostream uses nonexistent num_put member functions.
+ const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
+ if (__fmt == ios_base::oct || __fmt == ios_base::hex)
+ return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
+ else
+ return _M_insert(static_cast<long>(__n));
+ }
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
// Input streams -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
{ return _M_extract(__n); }
__istream_type&
- operator>>(short& __n)
- {
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 118. basic_istream uses nonexistent num_get member functions.
- long __l;
- _M_extract(__l);
- if (!this->fail())
- {
- if (numeric_limits<short>::min() <= __l
- && __l <= numeric_limits<short>::max())
- __n = __l;
- else
- this->setstate(ios_base::failbit);
- }
- return *this;
- }
+ operator>>(short& __n);
__istream_type&
operator>>(unsigned short& __n)
{ return _M_extract(__n); }
__istream_type&
- operator>>(int& __n)
- {
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 118. basic_istream uses nonexistent num_get member functions.
- long __l;
- _M_extract(__l);
- if (!this->fail())
- {
- if (numeric_limits<int>::min() <= __l
- && __l <= numeric_limits<int>::max())
- __n = __l;
- else
- this->setstate(ios_base::failbit);
- }
- return *this;
- }
-
+ operator>>(int& __n);
+
__istream_type&
operator>>(unsigned int& __n)
{ return _M_extract(__n); }
// Output streams -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
{ return _M_insert(__n); }
__ostream_type&
- operator<<(short __n)
- {
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 117. basic_ostream uses nonexistent num_put member functions.
- const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- if (__fmt == ios_base::oct || __fmt == ios_base::hex)
- return _M_insert(static_cast<long>(static_cast<unsigned short>(__n)));
- else
- return _M_insert(static_cast<long>(__n));
- }
+ operator<<(short __n);
__ostream_type&
operator<<(unsigned short __n)
}
__ostream_type&
- operator<<(int __n)
- {
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 117. basic_ostream uses nonexistent num_put member functions.
- const ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- if (__fmt == ios_base::oct || __fmt == ios_base::hex)
- return _M_insert(static_cast<long>(static_cast<unsigned int>(__n)));
- else
- return _M_insert(static_cast<long>(__n));
- }
+ operator<<(int __n);
__ostream_type&
operator<<(unsigned int __n)