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

Issue 2075783002: Adding additional comparison operators for GeneralizedTime. (Closed)

Created:
4 years, 6 months ago by svaldez
Modified:
4 years, 6 months ago
Reviewers:
davidben, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adding additional comparison operators for GeneralizedTime. BUG= Committed: https://crrev.com/fbb800feef57571197fc5c02d2ea5c19fa5d772e Cr-Commit-Position: refs/heads/master@{#400255}

Patch Set 1 #

Patch Set 2 : Add unittest. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -0 lines) Patch
M net/der/parse_values.h View 1 chunk +6 lines, -0 lines 0 comments Download
M net/der/parse_values.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M net/der/parse_values_unittest.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
davidben
lgtm
4 years, 6 months ago (2016-06-16 19:51:45 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2075783002/20001
4 years, 6 months ago (2016-06-16 19:52:43 UTC) #4
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 6 months ago (2016-06-16 20:58:02 UTC) #5
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/fbb800feef57571197fc5c02d2ea5c19fa5d772e Cr-Commit-Position: refs/heads/master@{#400255}
4 years, 6 months ago (2016-06-16 20:59:18 UTC) #7
Ryan Sleevi
FWIW, I don't think we should do this. using std::rel_ops should be what people use ...
4 years, 6 months ago (2016-06-16 21:37:14 UTC) #9
davidben
On 2016/06/16 21:37:14, Ryan Sleevi wrote: > FWIW, I don't think we should do this. ...
4 years, 6 months ago (2016-06-16 22:04:05 UTC) #10
Ryan Sleevi
4 years, 6 months ago (2016-06-16 22:21:27 UTC) #11
Message was sent while issue was closed.
On 2016/06/16 22:04:05, davidben wrote:
> Huh, never seen that before! Interesting.
> 
> Although we don't seem to use std::rel_ops anywhere else, while we do this
> everywhere else, including base::Optional which is both in base and a recent
> addition, so my interpretation is this is the most recent practice.

Up until very recently, the style guide banned overloading the operators at all.

> 
>
https://cs.chromium.org/search/?q=operator%3E%3D+-file:third_party&sq=package...
> 
> Perhaps propose to cxx@ or chromium-dev@ that we use std::rel_ops? Though the
> internal repo seems also more fond of operator>= than std::rel_ops. One could
> certainly argue that std::rel_ops, by not applying to just one type, causes
more
> weird action-at-a-distance issues.

It's C++. I'm not sure why you're suggesting a proposal - this isn't some
esoteric C++11 functionality - it's core to std::utility and, by proxy, most of
the STL.

It really depends on how much of the API contract you want to make your
comparators. The trade-offs between overload and rel-ops is that anyone who
wants to use a comparator other than ==/< has to "using std::rel_ops" at their
callsite, since ADL/Koenig won't find it otherwise. For something like this -
where there's only one need to compare GeneralizedTime, I lean towards the 'less
is more' approach.

Powered by Google App Engine
This is Rietveld 408576698