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

Side by Side Diff: base/move.h

Issue 599313003: Add nullptr support to scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr: addtestsforconversion Created 6 years, 2 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 | « base/memory/scoped_ptr_unittest.cc ('k') | 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 #ifndef BASE_MOVE_H_ 5 #ifndef BASE_MOVE_H_
6 #define BASE_MOVE_H_ 6 #define BASE_MOVE_H_
7 7
8 // Macro with the boilerplate that makes a type move-only in C++03. 8 // Macro with the boilerplate that makes a type move-only in C++03.
9 // 9 //
10 // USAGE 10 // USAGE
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 type* object; \ 208 type* object; \
209 }; \ 209 }; \
210 type(type&); \ 210 type(type&); \
211 void operator=(type&); \ 211 void operator=(type&); \
212 public: \ 212 public: \
213 operator rvalue_type() { return rvalue_type(this); } \ 213 operator rvalue_type() { return rvalue_type(this); } \
214 type Pass() { return type(rvalue_type(this)); } \ 214 type Pass() { return type(rvalue_type(this)); } \
215 typedef void MoveOnlyTypeForCPP03; \ 215 typedef void MoveOnlyTypeForCPP03; \
216 private: 216 private:
217 217
218 #define MOVE_ONLY_TYPE_FOR_CPP_03_WITH_MOVE_CONSTRUCTOR(type) \
219 private: \
220 type(type&); \
221 void operator=(type&); \
222 public: \
223 typedef void MoveOnlyTypeForCPP03; \
224 type&& Pass() { return static_cast<type&&>(*this); } \
jamesr 2014/09/26 20:22:45 no, this is not something we should add as a gener
danakj 2014/09/26 20:57:52 Why? It's only useful if they also add a T&& const
225 private:
226
218 #endif // BASE_MOVE_H_ 227 #endif // BASE_MOVE_H_
OLDNEW
« no previous file with comments | « base/memory/scoped_ptr_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698