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

Unified Diff: base/callback_internal.h

Issue 1496403002: base: Stop using Pass() on move-only types in Bind and Callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« base/bind_helpers.h ('K') | « base/bind_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_internal.h
diff --git a/base/callback_internal.h b/base/callback_internal.h
index 8f0c2b399924867d48a9b79c030f38904609c62f..aa8542cf48f9b316e4cc1b4c7963b431b81ed584 100644
--- a/base/callback_internal.h
+++ b/base/callback_internal.h
@@ -93,7 +93,7 @@ class BASE_EXPORT CallbackBase {
};
// A helper template to determine if given type is non-const move-only-type,
-// i.e. if a value of the given type should be passed via .Pass() in a
+// i.e. if a value of the given type should be passed via std::move() in a
// destructive way.
template <typename T> struct IsMoveOnlyType {
template <typename U>
@@ -197,7 +197,7 @@ struct CallbackParamTraitsForMoveOnlyType {
// default template compiles out to be a no-op.
//
// In C++11, std::forward would replace all uses of this function. However, it
-// is impossible to implement a general std::forward with C++11 due to a lack
+// is impossible to implement a general std::forward without C++11 due to a lack
// of rvalue references.
//
// In addition to Callback/Bind, this is used by PostTaskAndReplyWithResult to
@@ -213,7 +213,7 @@ typename std::enable_if<!IsMoveOnlyType<T>::value, T>::type& CallbackForward(
template <typename T>
typename std::enable_if<IsMoveOnlyType<T>::value, T>::type CallbackForward(
T& t) {
- return t.Pass();
+ return std::move(t);
}
} // namespace internal
« base/bind_helpers.h ('K') | « base/bind_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698