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 #ifndef BASE_MOVE_H_ | 5 #ifndef BASE_MOVE_H_ |
6 #define BASE_MOVE_H_ | 6 #define BASE_MOVE_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" |
11 | 12 |
12 // TODO(crbug.com/566182): DEPRECATED! | 13 // TODO(crbug.com/566182): DEPRECATED! |
13 // Use DISALLOW_COPY_AND_ASSIGN instead, or if your type will be used in | 14 // Use DISALLOW_COPY_AND_ASSIGN instead, or if your type will be used in |
14 // Callbacks, use DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND instead. | 15 // Callbacks, use DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND instead. |
15 #define MOVE_ONLY_TYPE_FOR_CPP_03(type) \ | 16 #define MOVE_ONLY_TYPE_FOR_CPP_03(type) \ |
16 DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(type) | 17 DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(type) |
17 | 18 |
18 // A macro to disallow the copy constructor and copy assignment functions. | 19 // A macro to disallow the copy constructor and copy assignment functions. |
19 // This should be used in the private: declarations for a class. | 20 // This should be used in the private: declarations for a class. |
20 // | 21 // |
(...skipping 13 matching lines...) Expand all Loading... |
34 type(const type&) = delete; \ | 35 type(const type&) = delete; \ |
35 void operator=(const type&) = delete; \ | 36 void operator=(const type&) = delete; \ |
36 \ | 37 \ |
37 public: \ | 38 public: \ |
38 type&& Pass() WARN_UNUSED_RESULT { return std::move(*this); } \ | 39 type&& Pass() WARN_UNUSED_RESULT { return std::move(*this); } \ |
39 typedef void MoveOnlyTypeForCPP03; \ | 40 typedef void MoveOnlyTypeForCPP03; \ |
40 \ | 41 \ |
41 private: | 42 private: |
42 | 43 |
43 #endif // BASE_MOVE_H_ | 44 #endif // BASE_MOVE_H_ |
OLD | NEW |