Clean up base::Callback stuff
* Typo fix
* Remove unused or duplicated forward decls
* Make Callback ctor explicit
* Simplify BindState param by expanding TypeList
BUG=
Review URL: https://codereview.chromium.org/1507143003
Cr-Commit-Position: refs/heads/master@{#365184}
CrOS-Libchrome-Original-Commit: ce3ecf87d878414a8b475549c72ae799f1e1c5c9
diff --git a/base/bind_internal.h b/base/bind_internal.h
index c6832e6..49ce0ed 100644
--- a/base/bind_internal.h
+++ b/base/bind_internal.h
@@ -39,12 +39,7 @@
// even if the invocation syntax differs.
// RunType -- A function type (as opposed to function _pointer_ type) for
// a Run() function. Usually just a convenience typedef.
-// (Bound)ArgsType -- A function type that is being (ab)used to store the
-// types of set of arguments. The "return" type is always
-// void here. We use this hack so that we do not need
-// a new type name for each arity of type. (eg.,
-// BindState1, BindState2). This makes forward
-// declarations and friending much much easier.
+// (Bound)Args -- A set of types that stores the arguments.
//
// Types:
// RunnableAdapter<> -- Wraps the various "function" pointer types into an
@@ -56,7 +51,6 @@
// signature adapters are applied.
// MakeRunnable<> -- Takes a Functor and returns an object in the Runnable
// type class that represents the underlying Functor.
-// There are |O(1)| MakeRunnable types.
// InvokeHelper<> -- Take a Runnable + arguments and actully invokes it.
// Handle the differing syntaxes needed for WeakPtr<>
// support, and for ignoring return values. This is separate
@@ -360,19 +354,18 @@
// Normally, this is the same as the RunType of the Runnable, but it can
// be different if an adapter like IgnoreResult() has been used.
//
-// BoundArgsType contains the storage type for all the bound arguments by
-// (ab)using a function type.
-template <typename Runnable, typename RunType, typename BoundArgList>
+// BoundArgs contains the storage type for all the bound arguments.
+template <typename Runnable, typename RunType, typename... BoundArgs>
struct BindState;
template <typename Runnable,
typename R,
typename... Args,
typename... BoundArgs>
-struct BindState<Runnable, R(Args...), TypeList<BoundArgs...>> final
+struct BindState<Runnable, R(Args...), BoundArgs...> final
: public BindStateBase {
private:
- using StorageType = BindState<Runnable, R(Args...), TypeList<BoundArgs...>>;
+ using StorageType = BindState<Runnable, R(Args...), BoundArgs...>;
using RunnableType = Runnable;
// true_type if Runnable is a method invocation and the first bound argument