diff options
Diffstat (limited to 'chromium/third_party/webrtc/system_wrappers/source/move.h')
-rw-r--r-- | chromium/third_party/webrtc/system_wrappers/source/move.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chromium/third_party/webrtc/system_wrappers/source/move.h b/chromium/third_party/webrtc/system_wrappers/source/move.h index 53109c73ad6..2e93641f456 100644 --- a/chromium/third_party/webrtc/system_wrappers/source/move.h +++ b/chromium/third_party/webrtc/system_wrappers/source/move.h @@ -144,6 +144,16 @@ // choose the one that adheres to the standard. // // +// WHY HAVE typedef void MoveOnlyTypeForCPP03 +// +// Callback<>/Bind() needs to understand movable-but-not-copyable semantics +// to call .Pass() appropriately when it is expected to transfer the value. +// The cryptic typedef MoveOnlyTypeForCPP03 is added to make this check +// easy and automatic in helper templates for Callback<>/Bind(). +// See IsMoveOnlyType template and its usage in base/callback_internal.h +// for more details. +// +// // COMPARED TO C++11 // // In C++11, you would implement this functionality using an r-value reference @@ -210,6 +220,7 @@ public: \ operator rvalue_type() { return rvalue_type(this); } \ type Pass() { return type(rvalue_type(this)); } \ + typedef void MoveOnlyTypeForCPP03; \ private: #endif // WEBRTC_SYSTEM_WRAPPERS_INTEFACE_MOVE_H_ |