Auto-Submit | +0 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | Gerrit |
Code-Review | +1 |
// Written this way because std::isfinite is not reliably constexpr.
nit: maybe mention that it might be in C++23 ?
if (!std::is_constant_evaluated() && ClampedMulFastOp<T, U>::is_supported) {
can this be constexpr-if ?
void TestWrappingMathSigned() {
Nice, how this folds into one overloaded form.
if (std::is_constant_evaluated() || sizeof(Storage) > sizeof(int)) {
constexpr-if ? and below.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | Gerrit |
// Written this way because std::isfinite is not reliably constexpr.
nit: maybe mention that it might be in C++23 ?
or rather, that it will be if I'm reading cppreference correctly.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | Gerrit |
// Written this way because std::isfinite is not reliably constexpr.
Tom Sepeznit: maybe mention that it might be in C++23 ?
or rather, that it will be if I'm reading cppreference correctly.
Done
if (!std::is_constant_evaluated() && ClampedMulFastOp<T, U>::is_supported) {
can this be constexpr-if ?
It cannot; if you force the conditional to be compile-time-evaluated like that, then `is_constant_evaluated()` is always true, so the negative branch becomes dead, and the compiler yells at you.
This is sorta weird and unintuitive, I had to test it.
if (std::is_constant_evaluated() || sizeof(Storage) > sizeof(int)) {
Peter Kastingconstexpr-if ? and below.
Acknowledged
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | Gerrit |
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
base/numerics cleanup 2/n: More modern techniques
* Use `std::is_constant_evaluated()`
* Use `_t` versions of type traits
* Use concepts more when available
* Convert more asserts to constraints
* const -> constexpr more
* if -> constexpr if more
* =default and assign-in-declaration
* `std::conditional_t<>` instead of specializations more
* Rely on C++20 rewritten comparison ops
* assert message is optional
Also removes a few pieces of dead code.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. | Gerrit |