diff --git a/stl/inc/complex b/stl/inc/complex index 281c326d47..3faff546ae 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -1402,14 +1402,14 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); - _Tmp.real(_Tmp.real() + _Right); + _Tmp += _Right; return _Tmp; } template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const _Ty& _Left, const complex<_Ty>& _Right) { - complex<_Ty> _Tmp(_Left); - _Tmp += _Right; + complex<_Ty> _Tmp(_Right); + _Tmp += _Left; return _Tmp; } @@ -1423,7 +1423,7 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); - _Tmp.real(_Tmp.real() - _Right); + _Tmp -= _Right; return _Tmp; } @@ -1444,15 +1444,14 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const template _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); - _Tmp.real(_Tmp.real() * _Right); - _Tmp.imag(_Tmp.imag() * _Right); + _Tmp *= _Right; return _Tmp; } template _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const _Ty& _Left, const complex<_Ty>& _Right) { - complex<_Ty> _Tmp(_Left); - _Tmp *= _Right; + complex<_Ty> _Tmp(_Right); + _Tmp *= _Left; return _Tmp; } @@ -1466,8 +1465,7 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const template _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); - _Tmp.real(_Tmp.real() / _Right); - _Tmp.imag(_Tmp.imag() / _Right); + _Tmp /= _Right; return _Tmp; }