| 1 | // The template and inlines for the -*- C++ -*- complex number classes. |
| 2 | |
| 3 | // Copyright (C) 2000-2025 Free Software Foundation, Inc. |
| 4 | // |
| 5 | // This file is part of the GNU ISO C++ Library. This library is free |
| 6 | // software; you can redistribute it and/or modify it under the |
| 7 | // terms of the GNU General Public License as published by the |
| 8 | // Free Software Foundation; either version 3, or (at your option) |
| 9 | // any later version. |
| 10 | |
| 11 | // This library is distributed in the hope that it will be useful, |
| 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | // GNU General Public License for more details. |
| 15 | |
| 16 | // Under Section 7 of GPL version 3, you are granted additional |
| 17 | // permissions described in the GCC Runtime Library Exception, version |
| 18 | // 3.1, as published by the Free Software Foundation. |
| 19 | |
| 20 | // You should have received a copy of the GNU General Public License and |
| 21 | // a copy of the GCC Runtime Library Exception along with this program; |
| 22 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 23 | // <http://www.gnu.org/licenses/>. |
| 24 | |
| 25 | #include <complex> |
| 26 | |
| 27 | namespace std _GLIBCXX_VISIBILITY(default) |
| 28 | { |
| 29 | _GLIBCXX_BEGIN_NAMESPACE_VERSION |
| 30 | |
| 31 | template |
| 32 | basic_istream<char, char_traits<char> >& |
| 33 | operator>>(basic_istream<char, char_traits<char> >&, complex<float>&); |
| 34 | |
| 35 | template |
| 36 | basic_ostream<char, char_traits<char> >& |
| 37 | operator<<(basic_ostream<char, char_traits<char> >&, |
| 38 | const complex<float>&); |
| 39 | |
| 40 | template |
| 41 | basic_istream<char, char_traits<char> >& |
| 42 | operator>>(basic_istream<char, char_traits<char> >&, complex<double>&); |
| 43 | |
| 44 | template |
| 45 | basic_ostream<char, char_traits<char> >& |
| 46 | operator<<(basic_ostream<char, char_traits<char> >&, |
| 47 | const complex<double>&); |
| 48 | |
| 49 | template |
| 50 | basic_istream<char, char_traits<char> >& |
| 51 | operator>>(basic_istream<char, char_traits<char> >&, |
| 52 | complex<long double>&); |
| 53 | |
| 54 | template |
| 55 | basic_ostream<char, char_traits<char> >& |
| 56 | operator<<(basic_ostream<char, char_traits<char> >&, |
| 57 | const complex<long double>&); |
| 58 | |
| 59 | #ifdef _GLIBCXX_USE_WCHAR_T |
| 60 | template |
| 61 | basic_istream<wchar_t, char_traits<wchar_t> >& |
| 62 | operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, |
| 63 | complex<float>&); |
| 64 | |
| 65 | template |
| 66 | basic_ostream<wchar_t, char_traits<wchar_t> >& |
| 67 | operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, |
| 68 | const complex<float>&); |
| 69 | |
| 70 | template |
| 71 | basic_istream<wchar_t, char_traits<wchar_t> >& |
| 72 | operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, |
| 73 | complex<double>&); |
| 74 | |
| 75 | template |
| 76 | basic_ostream<wchar_t, char_traits<wchar_t> >& |
| 77 | operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, |
| 78 | const complex<double>&); |
| 79 | |
| 80 | template |
| 81 | basic_istream<wchar_t, char_traits<wchar_t> >& |
| 82 | operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&, |
| 83 | complex<long double>&); |
| 84 | |
| 85 | template |
| 86 | basic_ostream<wchar_t, char_traits<wchar_t> >& |
| 87 | operator<<(basic_ostream<wchar_t, char_traits<wchar_t> >&, |
| 88 | const complex<long double>&); |
| 89 | #endif //_GLIBCXX_USE_WCHAR_T |
| 90 | |
| 91 | _GLIBCXX_END_NAMESPACE_VERSION |
| 92 | } // namespace |
| 93 | |
| 94 | // XXX GLIBCXX_ABI Deprecated |
| 95 | #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT |
| 96 | |
| 97 | #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \ |
| 98 | extern "C" void ldbl (...) __attribute__ ((alias (#dbl), weak)) |
| 99 | |
| 100 | _GLIBCXX_LDBL_COMPAT (_ZStlsIdcSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E, |
| 101 | _ZStlsIecSt11char_traitsIcEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E); |
| 102 | #ifdef _GLIBCXX_USE_WCHAR_T |
| 103 | _GLIBCXX_LDBL_COMPAT (_ZStlsIdwSt11char_traitsIwEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E, |
| 104 | _ZStlsIewSt11char_traitsIwEERSt13basic_ostreamIT0_T1_ES6_RKSt7complexIT_E); |
| 105 | #endif |
| 106 | _GLIBCXX_LDBL_COMPAT (_ZStrsIdcSt11char_traitsIcEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E, |
| 107 | _ZStrsIecSt11char_traitsIcEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E); |
| 108 | #ifdef _GLIBCXX_USE_WCHAR_T |
| 109 | _GLIBCXX_LDBL_COMPAT (_ZStrsIdwSt11char_traitsIwEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E, |
| 110 | _ZStrsIewSt11char_traitsIwEERSt13basic_istreamIT0_T1_ES6_RSt7complexIT_E); |
| 111 | #endif |
| 112 | |
| 113 | #endif // _GLIBCXX_LONG_DOUBLE_COMPAT |