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

Unified Diff: base/callback.h

Issue 1498973002: WIP: base::Bind for rvalue references. (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
« no previous file with comments | « base/bind_unittest.cc ('k') | base/callback_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback.h
diff --git a/base/callback.h b/base/callback.h
index 00669dd83d1c2dbb518134f0243fd5dbec104133..8a6e1d4008c3568e56929ee643302d34c7b405a8 100644
--- a/base/callback.h
+++ b/base/callback.h
@@ -388,16 +388,16 @@ class Callback<R(Args...)> : public internal::CallbackBase {
return CallbackBase::Equals(other);
}
- R Run(typename internal::CallbackParamTraits<Args>::ForwardType... args)
- const {
+ template <typename... RunArgs>
+ R Run(RunArgs&&... args) const {
PolymorphicInvoke f =
reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_);
- return f(bind_state_.get(), internal::CallbackForward(args)...);
+ return f(bind_state_.get(), std::forward<RunArgs>(args)...);
}
private:
- typedef R(*PolymorphicInvoke)(
+ typedef R (*PolymorphicInvoke)(
internal::BindStateBase*,
typename internal::CallbackParamTraits<Args>::ForwardType...);
};
« no previous file with comments | « base/bind_unittest.cc ('k') | base/callback_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698