Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Issue 2545253002: Add support for CheckedNumeric Max and Min constexpr functions (Closed)

Created:
4 years ago by jschuh
Modified:
4 years ago
Reviewers:
dcheng
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for CheckedNumeric Max and Min constexpr functions This also adds variadic helper functions CheckMax and CheckMin that return the maximum or minimum (respectively) result of an arbitrary number of arithmetic, CheckedNumeric, or StrictNumeric arguments. Committed: https://crrev.com/711ac6a11fe3f06803f2f3d76f199e7ac67574bf Cr-Commit-Position: refs/heads/master@{#436190}

Patch Set 1 #

Patch Set 2 : nits #

Patch Set 3 : stupid compilers with weak constexpr float support #

Total comments: 7

Patch Set 4 : MakeStrict #

Patch Set 5 : MakeStrictNum #

Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -35 lines) Patch
M base/numerics/safe_conversions.h View 1 2 3 4 3 chunks +10 lines, -0 lines 0 comments Download
M base/numerics/safe_conversions_impl.h View 2 chunks +29 lines, -5 lines 0 comments Download
M base/numerics/safe_math.h View 1 10 chunks +68 lines, -11 lines 0 comments Download
M base/numerics/safe_math_impl.h View 1 2 chunks +46 lines, -1 line 0 comments Download
M base/numerics/safe_numerics_unittest.cc View 1 2 3 4 3 chunks +46 lines, -18 lines 0 comments Download

Messages

Total messages: 19 (10 generated)
jschuh
dcheng@ - Feel free to punt this back if you don't have time to review. ...
4 years ago (2016-12-03 19:25:05 UTC) #4
dcheng
https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h File base/numerics/safe_conversions.h (right): https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h#newcode236 base/numerics/safe_conversions.h:236: constexpr StrictNumeric<typename UnderlyingType<T>::type> StrictNum( Nit: usually we name the ...
4 years ago (2016-12-03 21:34:29 UTC) #7
jschuh
https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h File base/numerics/safe_conversions.h (right): https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h#newcode236 base/numerics/safe_conversions.h:236: constexpr StrictNumeric<typename UnderlyingType<T>::type> StrictNum( On 2016/12/03 21:34:29, dcheng wrote: ...
4 years ago (2016-12-03 22:29:13 UTC) #8
dcheng
LGTM https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h File base/numerics/safe_conversions.h (right): https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h#newcode236 base/numerics/safe_conversions.h:236: constexpr StrictNumeric<typename UnderlyingType<T>::type> StrictNum( On 2016/12/03 22:29:12, jschuh ...
4 years ago (2016-12-04 01:42:15 UTC) #9
jschuh
On 2016/12/04 01:42:15, dcheng wrote: > LGTM > > https://codereview.chromium.org/2545253002/diff/40001/base/numerics/safe_conversions.h > File base/numerics/safe_conversions.h (right): > ...
4 years ago (2016-12-04 03:34:52 UTC) #10
dcheng
On 2016/12/04 03:34:52, jschuh (very slow) wrote: > On 2016/12/04 01:42:15, dcheng wrote: > > ...
4 years ago (2016-12-04 03:41:41 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2545253002/100001
4 years ago (2016-12-04 05:30:05 UTC) #15
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years ago (2016-12-04 07:18:48 UTC) #17
commit-bot: I haz the power
4 years ago (2016-12-04 07:20:20 UTC) #19
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/711ac6a11fe3f06803f2f3d76f199e7ac67574bf
Cr-Commit-Position: refs/heads/master@{#436190}

Powered by Google App Engine
This is Rietveld 408576698