OLD | NEW |
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(type&); \ |
223 void operator=(type&); \ | 223 void operator=(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 #define TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(type) \ |
| 230 public: \ |
| 231 type&& Pass() WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \ |
| 232 private: |
| 233 |
229 #endif // BASE_MOVE_H_ | 234 #endif // BASE_MOVE_H_ |
OLD | NEW |