Fix nested ternary operator returns in base/numerics constexpr functions |
||||
Issue description
Once we're fully C++14 we can get rid of the ugly, multiply-nested ternary operator returns that are used across the base/numerics constexpr functions. Here's an example from base/numerics/checked_math.h:
constexpr CheckedNumeric operator-() const {
// The negation of two's complement int min is int min, so we simply
// check for that in the constexpr case.
// We use an optimized code path for a known run-time variable.
return MustTreatAsConstexpr(state_.value()) || !std::is_signed<T>::value ||
std::is_floating_point<T>::value
? CheckedNumeric<T>(
NegateWrapper(state_.value()),
IsValid() && (!std::is_signed<T>::value ||
std::is_floating_point<T>::value ||
NegateWrapper(state_.value()) !=
std::numeric_limits<T>::lowest()))
: FastRuntimeNegate();
}
,
Jul 26 2017
,
Jul 26
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 3
This bug has an owner, thus, it's been triaged. Changing status to "assigned". |
||||
►
Sign in to add a comment |
||||
Comment 1 by jsc...@chromium.org
, Jul 21 2017