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

Issue 792763002: tuple: further generalize/simplify Tuple implementation (Closed)

Created:
6 years ago by mdempsky
Modified:
6 years ago
Reviewers:
Nico, tzik
CC:
chromium-reviews, erikwright+watch_chromium.org, Nico, dcheng
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

tuple: further generalize/simplify Tuple implementation Instead of specially implementing Tuple for 0 to 8 arguments, use a more traditional implementation by having Tuple<A, B, ...> inherit from TupleLeaf<0, A>, TupleLeaf<1, B>, etc. This allows Tuple to be used with an arbitrary number of arguments. To remain backwards compatible with code that accesses "t.a", "t.b", etc., we specialize TupleLeaf for the first 8 elements to store their values in appropriately named member variables. These accessors work even for Tuples with more than 8 elements, but the 9th element and beyond are only supported with get<N>(). Committed: https://crrev.com/06c626a8091b04618d0859e259f6a53dba6c617a Cr-Commit-Position: refs/heads/master@{#307681}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Respond to tzik/thakis feedback #

Patch Set 3 : Remove NthType; add documentation for get<N>(Tuple&) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -285 lines) Patch
M base/tuple.h View 1 2 4 chunks +75 lines, -285 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
mdempsky
tzik: PTAL. I was reviewing my variadic template Tuple CL after sending to CQ, and ...
6 years ago (2014-12-10 05:13:24 UTC) #2
tzik
LGTM. Cool! I like this even more. # Please get this reviewed by an OWNER ...
6 years ago (2014-12-10 06:43:27 UTC) #3
Nico
Nice! https://codereview.chromium.org/792763002/diff/1/base/tuple.h File base/tuple.h (right): https://codereview.chromium.org/792763002/diff/1/base/tuple.h#newcode100 base/tuple.h:100: Tuple() : TupleBase<Ts...>() {} Isn't this the same ...
6 years ago (2014-12-10 07:00:32 UTC) #5
Nico
actually, to keep things moving lgtm with answers to my questions in the previous reply
6 years ago (2014-12-10 07:01:29 UTC) #6
mdempsky
(Clarifying/answering this one question before working on the other feedback.) https://codereview.chromium.org/792763002/diff/1/base/tuple.h File base/tuple.h (right): https://codereview.chromium.org/792763002/diff/1/base/tuple.h#newcode100 ...
6 years ago (2014-12-10 07:15:23 UTC) #7
mdempsky
Thanks! https://codereview.chromium.org/792763002/diff/1/base/tuple.h File base/tuple.h (right): https://codereview.chromium.org/792763002/diff/1/base/tuple.h#newcode50 base/tuple.h:50: : public MakeIndexSequenceImpl<N - 1, N - 1, ...
6 years ago (2014-12-10 07:46:03 UTC) #8
tzik
still LGTM.
6 years ago (2014-12-10 09:01:06 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/792763002/40001
6 years ago (2014-12-10 09:46:10 UTC) #11
commit-bot: I haz the power
Committed patchset #3 (id:40001)
6 years ago (2014-12-10 11:22:30 UTC) #12
commit-bot: I haz the power
6 years ago (2014-12-10 11:23:19 UTC) #13
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/06c626a8091b04618d0859e259f6a53dba6c617a
Cr-Commit-Position: refs/heads/master@{#307681}

Powered by Google App Engine
This is Rietveld 408576698