Skip to content

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

Description

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions