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

Issue 1436403003: Make scoped enums output streamable. (Closed)

Created:
5 years, 1 month ago by dcheng
Modified:
4 years, 8 months ago
Reviewers:
danakj, Nico
CC:
chromium-reviews, Jeffrey Yasskin, mdempsky, Ryan Sleevi, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make scoped enums output streamable. This lets scoped enums be used in various CHECK_* expressions, as well as streamed to LOG(x). BUG=555314

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix build more #

Patch Set 3 : Avoid std::underlying_type #

Patch Set 4 : operator<< #

Total comments: 5

Patch Set 5 : Comments #

Patch Set 6 : Ponies #

Patch Set 7 : Meh #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -61 lines) Patch
M base/logging.h View 1 2 3 4 5 6 2 chunks +67 lines, -3 lines 0 comments Download
M base/logging_unittest.cc View 1 2 3 4 5 6 2 chunks +24 lines, -1 line 0 comments Download
M base/task_scheduler/task_traits.h View 1 2 3 4 5 6 1 chunk +0 lines, -9 lines 0 comments Download
M base/task_scheduler/task_traits.cc View 1 2 3 4 5 6 1 chunk +0 lines, -31 lines 0 comments Download
M ui/touch_selection/touch_handle.cc View 1 2 3 4 1 chunk +0 lines, -17 lines 0 comments Download

Messages

Total messages: 21 (2 generated)
dcheng
A blatant abuse of template metaprogramming. https://codereview.chromium.org/1436403003/diff/1/base/logging.h File base/logging.h (right): https://codereview.chromium.org/1436403003/diff/1/base/logging.h#newcode12 base/logging.h:12: #include <type_traits> Pretty ...
5 years, 1 month ago (2015-11-13 03:30:24 UTC) #2
dcheng
So it turns out this doesn't compile on many bots. What version of libstdc++/libc++ are ...
5 years, 1 month ago (2015-11-13 19:38:46 UTC) #3
Nico
On 2015/11/13 19:38:46, dcheng wrote: > So it turns out this doesn't compile on many ...
5 years, 1 month ago (2015-11-13 19:57:12 UTC) #4
danakj
On Fri, Nov 13, 2015 at 11:38 AM, <dcheng@chromium.org> wrote: > So it turns out ...
5 years, 1 month ago (2015-11-13 19:57:33 UTC) #5
dcheng
On 2015/11/13 at 19:57:33, danakj wrote: > On Fri, Nov 13, 2015 at 11:38 AM, ...
5 years, 1 month ago (2015-11-13 20:01:50 UTC) #6
dcheng
On 2015/11/13 at 19:57:12, thakis wrote: > On 2015/11/13 19:38:46, dcheng wrote: > > So ...
5 years, 1 month ago (2015-11-13 20:03:24 UTC) #7
Nico
android needs investigating too; I think that's the most interesting failure. Good to know about ...
5 years, 1 month ago (2015-11-13 20:09:43 UTC) #8
dcheng
On 2015/11/13 at 20:09:43, thakis wrote: > android needs investigating too; I think that's the ...
5 years, 1 month ago (2015-11-16 18:35:04 UTC) #9
danakj
https://codereview.chromium.org/1436403003/diff/60001/base/logging_unittest.cc File base/logging_unittest.cc (right): https://codereview.chromium.org/1436403003/diff/60001/base/logging_unittest.cc#newcode263 base/logging_unittest.cc:263: enum class TestEnum { can you check fixed signed ...
5 years, 1 month ago (2015-11-20 19:42:28 UTC) #10
danakj
This fails for me: enum class E : size_t { kFoo }; TEST(Dana, Dana) { ...
5 years, 1 month ago (2015-11-20 19:43:49 UTC) #11
dcheng
On 2015/11/20 at 19:43:49, danakj wrote: > This fails for me: > > enum class ...
5 years, 1 month ago (2015-11-20 20:03:41 UTC) #12
danakj
On Fri, Nov 20, 2015 at 12:03 PM, <dcheng@chromium.org> wrote: > On 2015/11/20 at 19:43:49, ...
5 years, 1 month ago (2015-11-20 21:20:03 UTC) #13
danakj
ok I think I understand all the things and this looks good and helpful. few ...
5 years, 1 month ago (2015-11-20 21:33:58 UTC) #14
dcheng
https://codereview.chromium.org/1436403003/diff/60001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/1436403003/diff/60001/base/logging.h#newcode518 base/logging.h:518: // Type trait helper to detect scoped enums. On ...
5 years, 1 month ago (2015-11-23 18:42:13 UTC) #15
danakj
thanks lgtm. just make the test cover both signed/unsigned please.
5 years, 1 month ago (2015-11-23 18:52:19 UTC) #17
dcheng
I can fix the issue with std::is_signed always returning false for enums. However, there's a ...
5 years, 1 month ago (2015-11-23 23:03:17 UTC) #18
danakj
On Mon, Nov 23, 2015 at 3:03 PM, <dcheng@chromium.org> wrote: > I can fix the ...
4 years, 11 months ago (2016-01-07 00:21:38 UTC) #19
dcheng
So I spent some more time tinkering with this. First, the good news: Signed vs ...
4 years, 8 months ago (2016-04-15 08:41:46 UTC) #20
dcheng
4 years, 8 months ago (2016-04-15 21:14:10 UTC) #21
The more I work on this, the less useful I feel it is. It's been a couple
months, and there hasn't been overwhelming demand. There's a lot of template
magic involved, and it makes things generally harder to understand.

Given that, I'm just going to close this: if someone wants to champion this and
pick it up, feel free to: the complexity-payoff ratio just seems too high.

Powered by Google App Engine
This is Rietveld 408576698