diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-16 12:39:13 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-16 12:39:13 +0000 |
| commit | 59fa40034ee1eedee3f11a02495ac24e4a6b2053 (patch) | |
| tree | 576463cec9dd097b28ec6d73cc960383ecb55385 /libstdc++-v3/include/std/complex | |
| parent | 81d1ad0f663a8fccb18de33447cdc695c9087e83 (diff) | |
| download | ppe42-gcc-59fa40034ee1eedee3f11a02495ac24e4a6b2053.tar.gz ppe42-gcc-59fa40034ee1eedee3f11a02495ac24e4a6b2053.zip | |
2010-09-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/complex (complex<float>::operator=(float),
complex<float>::operator+=(float),
complex<float>::operator-=(float),
complex<double>::operator=(double),
complex<double>::operator+=(double),
complex<double>::operator-=(double),
complex<long double>::operator=(long double),
complex<long double>::operator+=(long double),
complex<long double>::operator-=(long double)): Simplify a tad,
just forward to the underlying __complex__ T operators, as
operator*= and operator/= already do.
* include/std/complex (complex<float>, complex<double>,
complex<long double>): Simplify spelling of return types, just
say complex, instead of complex<float>, complex<double>,
complex<long double>, respectively.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164337 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/complex')
| -rw-r--r-- | libstdc++-v3/include/std/complex | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index 6d3097e0a1e..31c44363137 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -1062,36 +1062,35 @@ _GLIBCXX_BEGIN_NAMESPACE(std) void imag(float __val) { __imag__ _M_value = __val; } - complex<float>& + complex& operator=(float __f) { - __real__ _M_value = __f; - __imag__ _M_value = 0.0f; + _M_value = __f; return *this; } - complex<float>& + complex& operator+=(float __f) { - __real__ _M_value += __f; + _M_value += __f; return *this; } - complex<float>& + complex& operator-=(float __f) { - __real__ _M_value -= __f; + _M_value -= __f; return *this; } - complex<float>& + complex& operator*=(float __f) { _M_value *= __f; return *this; } - complex<float>& + complex& operator/=(float __f) { _M_value /= __f; @@ -1103,7 +1102,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // complex& operator=(const complex&); template<typename _Tp> - complex<float>& + complex& operator=(const complex<_Tp>& __z) { __real__ _M_value = __z.real(); @@ -1112,7 +1111,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<float>& + complex& operator+=(const complex<_Tp>& __z) { __real__ _M_value += __z.real(); @@ -1121,7 +1120,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<class _Tp> - complex<float>& + complex& operator-=(const complex<_Tp>& __z) { __real__ _M_value -= __z.real(); @@ -1130,7 +1129,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<class _Tp> - complex<float>& + complex& operator*=(const complex<_Tp>& __z) { _ComplexT __t; @@ -1141,7 +1140,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<class _Tp> - complex<float>& + complex& operator/=(const complex<_Tp>& __z) { _ComplexT __t; @@ -1208,36 +1207,35 @@ _GLIBCXX_BEGIN_NAMESPACE(std) void imag(double __val) { __imag__ _M_value = __val; } - complex<double>& + complex& operator=(double __d) { - __real__ _M_value = __d; - __imag__ _M_value = 0.0; + _M_value = __d; return *this; } - complex<double>& + complex& operator+=(double __d) { - __real__ _M_value += __d; + _M_value += __d; return *this; } - complex<double>& + complex& operator-=(double __d) { - __real__ _M_value -= __d; + _M_value -= __d; return *this; } - complex<double>& + complex& operator*=(double __d) { _M_value *= __d; return *this; } - complex<double>& + complex& operator/=(double __d) { _M_value /= __d; @@ -1248,7 +1246,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // complex& operator=(const complex&); template<typename _Tp> - complex<double>& + complex& operator=(const complex<_Tp>& __z) { __real__ _M_value = __z.real(); @@ -1257,7 +1255,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<double>& + complex& operator+=(const complex<_Tp>& __z) { __real__ _M_value += __z.real(); @@ -1266,7 +1264,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<double>& + complex& operator-=(const complex<_Tp>& __z) { __real__ _M_value -= __z.real(); @@ -1275,7 +1273,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<double>& + complex& operator*=(const complex<_Tp>& __z) { _ComplexT __t; @@ -1286,7 +1284,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<double>& + complex& operator/=(const complex<_Tp>& __z) { _ComplexT __t; @@ -1354,36 +1352,35 @@ _GLIBCXX_BEGIN_NAMESPACE(std) void imag(long double __val) { __imag__ _M_value = __val; } - complex<long double>& + complex& operator=(long double __r) { - __real__ _M_value = __r; - __imag__ _M_value = 0.0L; + _M_value = __r; return *this; } - complex<long double>& + complex& operator+=(long double __r) { - __real__ _M_value += __r; + _M_value += __r; return *this; } - complex<long double>& + complex& operator-=(long double __r) { - __real__ _M_value -= __r; + _M_value -= __r; return *this; } - complex<long double>& + complex& operator*=(long double __r) { _M_value *= __r; return *this; } - complex<long double>& + complex& operator/=(long double __r) { _M_value /= __r; @@ -1394,7 +1391,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // complex& operator=(const complex&); template<typename _Tp> - complex<long double>& + complex& operator=(const complex<_Tp>& __z) { __real__ _M_value = __z.real(); @@ -1403,7 +1400,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<long double>& + complex& operator+=(const complex<_Tp>& __z) { __real__ _M_value += __z.real(); @@ -1412,7 +1409,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<long double>& + complex& operator-=(const complex<_Tp>& __z) { __real__ _M_value -= __z.real(); @@ -1421,7 +1418,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<long double>& + complex& operator*=(const complex<_Tp>& __z) { _ComplexT __t; @@ -1432,7 +1429,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } template<typename _Tp> - complex<long double>& + complex& operator/=(const complex<_Tp>& __z) { _ComplexT __t; |

