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>: real(T) and imag(T) setters should return void #190

Closed
StephanTLavavej opened this issue Oct 18, 2019 · 0 comments · Fixed by #367
Closed

<complex>: real(T) and imag(T) setters should return void #190

StephanTLavavej opened this issue Oct 18, 2019 · 0 comments · Fixed by #367
Labels
enhancement Something can be improved fixed Something works now, yay!

Comments

@StephanTLavavej
Copy link
Member

StephanTLavavej commented Oct 18, 2019

The return types of our complex setters are incorrect, compared with https://eel.is/c++draft/complex :

STL/stl/inc/complex

Lines 534 to 540 in 957fe99

_Ty real(const _Ty& _Right) { // set real component
return this->_Val[_RE] = _Right;
}
_Ty imag(const _Ty& _Right) { // set imaginary component
return this->_Val[_IM] = _Right;
}

This is technically a bug, but no user has noticed it. I could devise situations where this would affect conformant code, beyond just decltype.

We'll need to change these functions while implementing #16, so we may as well fix their return types while we're in the neighborhood. This is unlikely to be a significant source breaking change.

(Standardese citations as of WG21-N4835.)

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Oct 18, 2019
Neargye added a commit to neargye-forks/STL that referenced this issue Dec 10, 2019
Neargye added a commit to neargye-forks/STL that referenced this issue Mar 7, 2020
StephanTLavavej added a commit that referenced this issue Apr 30, 2020
Fixes #16 and fixes #190.

Co-authored-by: Curtis.Bezault <[email protected]>
Co-authored-by: Stephan T. Lavavej <[email protected]>
@StephanTLavavej StephanTLavavej added fixed Something works now, yay! and removed work in progress labels Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant