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

Issue 1653023003: Specialize IsMoveOnlyType<T> for vectors. (Closed)

Created:
4 years, 10 months ago by dcheng
Modified:
4 years, 10 months ago
Reviewers:
danakj
CC:
chromium-reviews, mdempsky, tzik, 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

Specialize IsMoveOnlyType<T> for vectors. Once VC++2015 is the default compiler for Windows, IsMoveOnlyType<T> can be improved to work generically for all types that are movable but not copyable. However, this check depends on the copy constructor being inaccessible, which is problematic for STL containers. A STL container containing a move-only type still has an accessible copy constructor, but attempting to use the copy constructor will trigger a compile error. In order to fix that, IsMoveOnlyType<T> now has a specialization for std::vector, and will treat a std::vector as move-only if the elements are move-only. BUG=554289 Committed: https://crrev.com/53b4cea9f4e7c510b68569003296345989e3bbca Cr-Commit-Position: refs/heads/master@{#372885}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Fix a few things #

Total comments: 6

Patch Set 3 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -0 lines) Patch
M base/bind_unittest.cc View 1 2 chunks +32 lines, -0 lines 0 comments Download
M base/callback_internal.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (8 generated)
dcheng
https://codereview.chromium.org/1653023003/diff/1/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/1653023003/diff/1/base/callback_internal.h#newcode14 base/callback_internal.h:14: #include <vector> Unfortunately, doing this means more opportunities for ...
4 years, 10 months ago (2016-02-01 21:26:03 UTC) #2
vmpstr
Does this mean that this would have to be done for basically all STL containers ...
4 years, 10 months ago (2016-02-01 21:36:16 UTC) #4
dcheng
On 2016/02/01 at 21:36:16, vmpstr wrote: > Does this mean that this would have to ...
4 years, 10 months ago (2016-02-01 22:16:54 UTC) #7
danakj
On Mon, Feb 1, 2016 at 2:16 PM, <dcheng@chromium.org> wrote: > On 2016/02/01 at 21:36:16, ...
4 years, 10 months ago (2016-02-01 22:18:37 UTC) #8
dcheng
On 2016/02/01 at 22:18:37, danakj wrote: > On Mon, Feb 1, 2016 at 2:16 PM, ...
4 years, 10 months ago (2016-02-01 22:23:58 UTC) #9
vmpstr
On 2016/02/01 22:23:58, dcheng wrote: > On 2016/02/01 at 22:18:37, danakj wrote: > > On ...
4 years, 10 months ago (2016-02-01 22:25:17 UTC) #10
dcheng
On 2016/02/01 at 22:25:17, vmpstr wrote: > On 2016/02/01 22:23:58, dcheng wrote: > > On ...
4 years, 10 months ago (2016-02-02 00:54:52 UTC) #11
danakj
LGTMM https://codereview.chromium.org/1653023003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/1653023003/diff/20001/base/callback_internal.h#newcode120 base/callback_internal.h:120: struct IsMoveOnlyType<std::unique_ptr<T, D>> : public std::true_type {}; nit: ...
4 years, 10 months ago (2016-02-02 01:38:33 UTC) #12
danakj
LGTM too
4 years, 10 months ago (2016-02-02 01:38:40 UTC) #13
danakj
https://codereview.chromium.org/1653023003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/1653023003/diff/20001/base/callback_internal.h#newcode126 base/callback_internal.h:126: : public IsMoveOnlyType<typename std::vector<T, Allocator>::value_type> {}; vlad's right though ...
4 years, 10 months ago (2016-02-02 01:39:21 UTC) #14
dcheng
https://codereview.chromium.org/1653023003/diff/20001/base/callback_internal.h File base/callback_internal.h (right): https://codereview.chromium.org/1653023003/diff/20001/base/callback_internal.h#newcode120 base/callback_internal.h:120: struct IsMoveOnlyType<std::unique_ptr<T, D>> : public std::true_type {}; On 2016/02/02 ...
4 years, 10 months ago (2016-02-02 01:52:11 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1653023003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1653023003/40001
4 years, 10 months ago (2016-02-02 01:52:35 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 10 months ago (2016-02-02 04:09:49 UTC) #20
commit-bot: I haz the power
4 years, 10 months ago (2016-02-02 04:11:43 UTC) #22
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/53b4cea9f4e7c510b68569003296345989e3bbca
Cr-Commit-Position: refs/heads/master@{#372885}

Powered by Google App Engine
This is Rietveld 408576698