This patch adds constexpr to <complex> header: operators, member operators, and member functions (real, imag, norm, conj).
https://eel.is/c++draft/complex.numbers
https://wg21.link/p0415
Differential D79555
[libc++] [C++20] [P0415] Constexpr for std::complex. curdeius on May 7 2020, 12:17 AM. Authored by
Details
This patch adds constexpr to <complex> header: operators, member operators, and member functions (real, imag, norm, conj). https://eel.is/c++draft/complex.numbers
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes Comment Actions
Comment Actions I've tested the non-specialization with __float128 and fixed missing constexpr there. The tests mainly pass apart from those testing operators * and / that use copysign which is ambiguous (already in non-constexpr context so I didn't pursue it any further). It's implementation-specific anyway. Comment Actions Can you please ping once you think this is ready to review? For now, I'll "request changes" so it shows up correctly in the review queue. Comment Actions Can you rebase onto main so that CI runs again? You'll also need to fix a few details like the cxx2a_status page which has changed.
Comment Actions
Comment Actions Fix rebase. Apply some review comments.
Comment Actions
Comment Actions Looks like your new rebase succeeded in preserving the "unforked" implementations of operator* and operator/. They LGTM code-wise now.
|