New issue
Advanced search Search tips

Issue 747509 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Fix nested ternary operator returns in base/numerics constexpr functions

Project Member Reported by jsc...@chromium.org, Jul 21 2017

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();
  }

 

Comment 1 by jsc...@chromium.org, Jul 21 2017

Owner: jsc...@chromium.org

Comment 2 by jsc...@chromium.org, Jul 26 2017

Components: Internals>BaseNumerics
Status: Available (was: Untriaged)
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 26

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".

Sign in to add a comment