Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<complex>: avoid unnecessary conversion of real arguments to complex #2855

Merged
merged 3 commits into from
Jul 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stl/inc/complex
Original file line number Diff line number Diff line change
Expand Up @@ -1408,8 +1408,8 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const

template <class _Ty>
_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;
}

Expand Down Expand Up @@ -1451,8 +1451,8 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const

template <class _Ty>
_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;
}

Expand Down