|
|
Created:
6 years, 2 months ago by tzik Modified:
6 years, 1 month ago Reviewers:
Aaron Boodman, Nico, awong CC:
chromium-reviews, erikwright+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Project:
chromium Visibility:
Public. |
Description[Base] Use variadic template in base/callback.h
Replace pump.py generated base/callback.h with variadic template version.
BUG=433164
Committed: https://crrev.com/c87149e666acfe39d49d7f30a5fd9acc7ef085ea
Cr-Commit-Position: refs/heads/master@{#304948}
Patch Set 1 #Patch Set 2 : workaround for win toolchain #
Total comments: 4
Patch Set 3 : strip an empty line. s/type/Type/. +TODO #Patch Set 4 : fix comment #Patch Set 5 : strip another empty line #
Total comments: 3
Patch Set 6 : #Patch Set 7 : rebase #
Created: 6 years, 1 month ago
Messages
Total messages: 25 (5 generated)
tzik@chromium.org changed reviewers: + ajwong@chromium.org
Hi, Albert. PTL. C++11 variadic template seems ready to use in chrome. I tried to make a CL to use it in Callback and Bind, though it doesn't compile on Windows yet. https://codereview.chromium.org/610313003/ Can we start using it from an easy piece?
LGTM Hell yes. Thank you for doing this.
On 2014/09/29 18:51:48, awong (On leave) wrote: > LGTM > > Hell yes. Thank you for doing this. Please also watch the build stats. I think we're going to see some speed ups (esp when we replace bind_internal) and it'd be nice to publish those results.
On 2014/09/29 18:52:28, awong (On leave) wrote: > On 2014/09/29 18:51:48, awong (On leave) wrote: > > LGTM > > > > Hell yes. Thank you for doing this. > > Please also watch the build stats. I think we're going to see some speed ups > (esp when we replace bind_internal) and it'd be nice to publish those results. Looks like we hit a compiler bug, reported as below. http://connect.microsoft.com/VisualStudio/feedbackdetail/view/957801/compilat... They said it is fixed in 'the "14" release of Visual C++', which is the next major release of MSVC.
PTAL. I added a workaround to CallbackParamTraits for MSVC 2013. It seems we can't use default template parameter and variadic template together.
thakis@chromium.org changed reviewers: + thakis@chromium.org
https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h... base/callback_internal.h:99: struct CallbackParamTraitsForNonMoveOnlyType; Should there be a "TODO: Use a default parameter once MSVS supports variadic templates with default values"?
(independent of your answer to my question, I like this cl.) On Tue, Sep 30, 2014 at 1:41 PM, <thakis@chromium.org> wrote: > > https://codereview.chromium.org/610423003/diff/20001/base/ > callback_internal.h > File base/callback_internal.h (right): > > https://codereview.chromium.org/610423003/diff/20001/base/ > callback_internal.h#newcode99 > base/callback_internal.h:99: struct > CallbackParamTraitsForNonMoveOnlyType; > Should there be a "TODO: Use a default parameter once MSVS supports > variadic templates with default values"? > > https://codereview.chromium.org/610423003/ > To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h... base/callback_internal.h:99: struct CallbackParamTraitsForNonMoveOnlyType; On 2014/09/30 11:41:04, Nico (away until Oct 27) wrote: > Should there be a "TODO: Use a default parameter once MSVS supports variadic > templates with default values"? Done.
Surprisingly, monolithic version of .pump replacement CL compiles on Windows without additional workaround! https://codereview.chromium.org/610313003/#ps120001
aa@chromium.org changed reviewers: + aa@chromium.org
https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h... base/callback_internal.h:84: // Returns Then as |type| if condition is true. Otherwise returns Else. The pipes are usually used around param names in chromium, so i think: Returns |Then| as SelectType::type when |condition| is true. Otherwise returns |Else|.
https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/610423003/diff/20001/base/callback_internal.h... base/callback_internal.h:84: // Returns Then as |type| if condition is true. Otherwise returns Else. On 2014/09/30 21:05:37, Aaron Boodman wrote: > The pipes are usually used around param names in chromium, so i think: > > Returns |Then| as SelectType::type when |condition| is true. Otherwise returns > |Else|. Done.
lgtm
https://codereview.chromium.org/610423003/diff/80001/base/callback.h File base/callback.h (right): https://codereview.chromium.org/610423003/diff/80001/base/callback.h#newcode411 base/callback.h:411: #endif // BASE_CALLBACK_H_ Oooh...nice catch. https://codereview.chromium.org/610423003/diff/80001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/610423003/diff/80001/base/callback_internal.h... base/callback_internal.h:103: // with default values. Can we cite a bit that has a reference to the MSVS issue that's requiring this code change?
https://codereview.chromium.org/610423003/diff/80001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/610423003/diff/80001/base/callback_internal.h... base/callback_internal.h:103: // with default values. On 2014/10/07 18:45:39, awong (On leave) wrote: > Can we cite a bit that has a reference to the MSVS issue that's requiring this > code change? Added an upstream bug link. Though, actually, I still don't understand when the compiler fails to compile, and which usage we should really avoid... I removed SFINAE/default template parameters, variable number of inheritance in single level, complex template specialization match, and multiple template pack expansion in single expression from the following CL. Each of them works fine individually though.
Albert: Could you take another look to this? I made a non-trivial change for MSVC2013 workaround after your LGTM in #3.
aa@chromium.org changed reviewers: - aa@chromium.org
Now the Windows toolchain is updated to MSVS Community 2013! That should compile this correctly. I rebased CL onto the ToT, the diff itself is not changed since last upload. Albert: Could you PTAL to the workaround part between PS1 and PS2?
diff from patch set 1 to 2 lgtm (albert seems away) Let's get this in, before another 2 people implement this :-/
The CQ bit was checked by thakis@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/610423003/120001
Message was sent while issue was closed.
Committed patchset #7 (id:120001)
Message was sent while issue was closed.
Patchset 7 (id:??) landed as https://crrev.com/c87149e666acfe39d49d7f30a5fd9acc7ef085ea Cr-Commit-Position: refs/heads/master@{#304948} |