diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-31 12:14:56 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-31 12:14:56 +0000 |
commit | 8878d5e46d4edcc706701f66d12dff79a5f51c0d (patch) | |
tree | ceaaac0bdc60dd79d70b07301e7aa375cd843bb4 /libstdc++-v3/src | |
parent | 9e8f09c322891cc1b2e3c187d3fcb24fe9e432e0 (diff) | |
download | gcc-8878d5e46d4edcc706701f66d12dff79a5f51c0d.tar.gz |
2001-05-30 Benjamin Kosnik <bkoz@redat.com>
* acconfig.h (_GLIBCPP_BUGGY_FLOAT_COMPLEX): Remove.
(_GLIBCPP_BUGGY_COMPLEX): Remove.
* config.h.in: Regenerate.
* acinclude.m4 (GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT): Remove.
* aclocal.m4: Regenerate.
* configure.in: Don't call it.
* configure: Regenerate.
libstdc++/2970
* src/complex_io.cc (operator<<(ostream&, const complex&): Fix.
* testsuite/26_numerics/complex_inserters_extractors.cc (test01):
New test.
libstdc++/2985
* include/bits/std_complex.h: Include sstream. Put definitions for
complex inserters and extractors here, and remove them from...
* src/complex_io.cc: ...here.
* include/bits/basic_ios.h (basic_ios::__numput_type): Add _Traits
parameter.
(basic_ios::__numget_type): Same.
* include/bits/std_istream.h: Same.
* include/bits/std_ostream.h: Same.
* include/bits/sbuf_iter.h (ostreambuf_iterator): Fix typo in base
class iterator template arguments.
* src/locale-inst.cc: Add explicit has_facet instantiations.
* include/bits/basic_ios.h (basic_ios::_M_get_fctype_ios): Remove.
(_M_get_fnumput): Remove.
(_M_get_fnumget): Remove.
(basic_ios::_M_check_facet): New function.
(basic_ios::_M_cache_facets): New function.
* include/bits/basic_ios.tcc: Definition for _M_cache_facets.
(basic_ios::imbue): Call _M_cache_facets.
(basic_ios::init): Same.
* include/bits/istream.tcc: Format, use _M_check_facet.
* include/bits/ostream.tcc: Same.
* include/bits/locale_facets.tcc (__output_float): Change
signature, add _Traits.
* testsuite/26_numerics/complex_inserters_extractors.cc (test02):
New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42743 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/complex_io.cc | 61 | ||||
-rw-r--r-- | libstdc++-v3/src/locale-inst.cc | 23 |
2 files changed, 24 insertions, 60 deletions
diff --git a/libstdc++-v3/src/complex_io.cc b/libstdc++-v3/src/complex_io.cc index 944414f0c0b..c4b8a95b5f8 100644 --- a/libstdc++-v3/src/complex_io.cc +++ b/libstdc++-v3/src/complex_io.cc @@ -1,6 +1,6 @@ // The template and inlines for the -*- C++ -*- complex number classes. -// Copyright (C) 2000 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -28,66 +28,9 @@ // the GNU General Public License. #include <bits/std_complex.h> -#include <bits/std_istream.h> -#include <bits/std_ostream.h> -#include <bits/std_sstream.h> namespace std { - - template<typename _Tp, typename _CharT, class _Traits> - basic_istream <_CharT, _Traits> & - operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) - { -#if !defined(_GLIBCPP_BUGGY_FLOAT_COMPLEX) && !defined(_GLIBCPP_BUGGY_COMPLEX) - _Tp __re_x, __im_x; - _CharT __ch; - __is >> __ch; - if (__ch == '(') - { - __is >> __re_x >> __ch; - if (__ch == ',') - { - __is >> __im_x >> __ch; - if (__ch == ')') - { - __x = complex<_Tp>(__re_x, __im_x); - return __is; - } - } - else if (__ch == ')') - { - __x = complex<_Tp>(__re_x, _Tp(0)); - return __is; - } - } - else - { - __is.putback(__ch); - __is >> __re_x; - __x = complex<_Tp>(__re_x, _Tp(0)); - return __is; - } - __is.setstate(ios_base::failbit); -#else - __x = complex<_Tp>(_Tp(0), _Tp(0)); -#endif - return __is; - } - - template<typename _Tp, typename _CharT, class _Traits> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) - { - basic_ostringstream<_CharT, _Traits> __s; - __s.flags(__os.flags()); - __s.imbue(__os.getloc()); - __s.precision (__os.precision()); - __s << '(' << __x.real() << "," << __x.imag() << ')' << ends; - return __os << __s.str(); - } - - template basic_istream<char, char_traits<char> >& operator>>(basic_istream<char, char_traits<char> >&, complex<float>&); @@ -149,3 +92,5 @@ namespace std #endif //_GLIBCPP_USE_WCHAR_T } // namespace std + + diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index a2027281ac4..0b9cf7564ea 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -170,11 +170,30 @@ namespace std // has_facet template bool - has_facet<numpunct<char> >(const locale &); + has_facet<numpunct<char> >(const locale&); + template + bool + has_facet<num_put<char> >(const locale&); + template + bool + has_facet<num_get<char> >(const locale&); + template + bool + has_facet<ctype<char> >(const locale&); + #ifdef _GLIBCPP_USE_WCHAR_T template bool - has_facet<numpunct<wchar_t> >(const locale &); + has_facet<numpunct<wchar_t> >(const locale&); + template + bool + has_facet<num_put<wchar_t> >(const locale&); + template + bool + has_facet<num_get<wchar_t> >(const locale&); + template + bool + has_facet<ctype<wchar_t> >(const locale&); #endif // |