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

Side by Side Diff: base/move.h

Issue 1061073004: Make deleted constructors take a const parameter in move-only type macro. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 6
7 #ifndef BASE_MOVE_H_ 7 #ifndef BASE_MOVE_H_
8 #define BASE_MOVE_H_ 8 #define BASE_MOVE_H_
9 9
10 // Macro with the boilerplate that makes a type move-only in C++03. 10 // Macro with the boilerplate that makes a type move-only in C++03.
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 type(type&); \ 212 type(type&); \
213 void operator=(type&); \ 213 void operator=(type&); \
214 public: \ 214 public: \
215 operator rvalue_type() { return rvalue_type(this); } \ 215 operator rvalue_type() { return rvalue_type(this); } \
216 type Pass() WARN_UNUSED_RESULT { return type(rvalue_type(this)); } \ 216 type Pass() WARN_UNUSED_RESULT { return type(rvalue_type(this)); } \
217 typedef void MoveOnlyTypeForCPP03; \ 217 typedef void MoveOnlyTypeForCPP03; \
218 private: 218 private:
219 219
220 #define MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(type) \ 220 #define MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(type) \
221 private: \ 221 private: \
222 type(type&); \ 222 type(const type&); \
mgraczyk 2015/04/07 01:10:31 This allows move-only types to be used in STL cont
Nico 2015/04/07 01:36:47 Only if your STL knows about move-only types, righ
mgraczyk 2015/04/07 05:32:59 It may or may not work after this change if the li
223 void operator=(type&); \ 223 void operator=(const type&); \
224 public: \ 224 public: \
225 type&& Pass() WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \ 225 type&& Pass() WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \
226 typedef void MoveOnlyTypeForCPP03; \ 226 typedef void MoveOnlyTypeForCPP03; \
227 private: 227 private:
228 228
229 #endif // BASE_MOVE_H_ 229 #endif // BASE_MOVE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698