First public contribution.
3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
19 #include "stlport_prefix.h"
26 #if !(defined (_STLP_MSVC) && _STLP_MSVC < 1200)
28 // Specializations for narrow characters; lets us avoid the nuisance of
31 basic_ostream<char, char_traits<char> >& _STLP_CALL
32 operator<< (basic_ostream<char, char_traits<char> >& __os, const complex<float>& __z)
33 { return __os << '(' << (double)__z.real() << ',' << (double)__z.imag() << ')'; }
36 basic_ostream<char, char_traits<char> >& _STLP_CALL
37 operator<< (basic_ostream<char, char_traits<char> >& __os, const complex<double>& __z)
38 { return __os << '(' << __z.real() << ',' << __z.imag() << ')'; }
40 # ifndef _STLP_NO_LONG_DOUBLE
42 basic_ostream<char, char_traits<char> >& _STLP_CALL
43 operator<< (basic_ostream<char, char_traits<char> >& __os, const complex<long double>& __z)
44 { return __os << '(' << __z.real() << ',' << __z.imag() << ')'; }
47 // Specialization for narrow characters; lets us avoid widen.
49 basic_istream<char, char_traits<char> >& _STLP_CALL
50 operator>>(basic_istream<char, char_traits<char> >& __is, complex<float>& __z) {
62 __is.setstate(ios_base::failbit);
70 __z = complex<float>(__re, __im);
75 basic_istream<char, char_traits<char> >& _STLP_CALL
76 operator>>(basic_istream<char, char_traits<char> >& __is, complex<double>& __z) {
88 __is.setstate(ios_base::failbit);
96 __z = complex<double>(__re, __im);
100 # ifndef _STLP_NO_LONG_DOUBLE
102 basic_istream<char, char_traits<char> >& _STLP_CALL
103 operator>>(basic_istream<char, char_traits<char> >& __is, complex<long double>& __z) {
104 long double __re = 0;
105 long double __im = 0;
115 __is.setstate(ios_base::failbit);
123 __z = complex<long double>(__re, __im);
130 // Force instantiation of complex I/O functions
131 #if !(defined (_STLP_NO_FORCE_INSTANTIATE) || defined (_STLP_NO_WCHAR_T))
133 _STLP_OPERATOR_SPEC basic_istream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
134 operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, complex<float>&);
136 _STLP_OPERATOR_SPEC basic_istream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
137 operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, complex<double>&);
139 #ifndef _STLP_NO_LONG_DOUBLE
140 _STLP_OPERATOR_SPEC basic_istream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
141 operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, complex<long double>&);
143 _STLP_OPERATOR_SPEC basic_ostream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
144 operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<long double>&);
147 _STLP_OPERATOR_SPEC basic_ostream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
148 operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<float>&);
150 _STLP_OPERATOR_SPEC basic_ostream<wchar_t, char_traits<wchar_t> >& _STLP_CALL
151 operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, const complex<double>&);
153 #endif /* _STLP_NO_WCHAR_T */