Index: base/bind.h |
diff --git a/base/bind.h b/base/bind.h |
index 94da5ac56a488f0fbd5b880f54705957591ac03b..5daf198fbbe1e3e8b568eeeb02beaf3529034be4 100644 |
--- a/base/bind.h |
+++ b/base/bind.h |
@@ -47,24 +47,6 @@ |
namespace base { |
-template <typename Functor> |
-base::Callback< |
- typename internal::BindState< |
- typename internal::FunctorTraits<Functor>::RunnableType, |
- typename internal::FunctorTraits<Functor>::RunType, |
- internal::TypeList<>>::UnboundRunType> |
-Bind(Functor functor) { |
- // Typedefs for how to store and run the functor. |
- typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; |
- typedef typename internal::FunctorTraits<Functor>::RunType RunType; |
- |
- typedef internal::BindState<RunnableType, RunType, |
- internal::TypeList<>> BindState; |
- |
- return Callback<typename BindState::UnboundRunType>( |
- new BindState(internal::MakeRunnable(functor))); |
-} |
- |
template <typename Functor, typename... Args> |
base::Callback< |
typename internal::BindState< |
@@ -83,12 +65,16 @@ Bind(Functor functor, const Args&... args) { |
// functor is going to interpret the argument as. |
typedef typename RunnableType::RunType BoundRunType; |
+ using BoundArgs = |
+ internal::TakeTypeListItem<sizeof...(Args), |
+ internal::ExtractArgs<BoundRunType>>; |
+ |
// Do not allow binding a non-const reference parameter. Non-const reference |
// parameters are disallowed by the Google style guide. Also, binding a |
// non-const reference parameter can make for subtle bugs because the |
// invoked function will receive a reference to the stored copy of the |
// argument and not the original. |
- static_assert(!internal::HasNonConstReferenceParam<BoundRunType>::value, |
+ static_assert(!internal::HasNonConstReferenceItem<BoundArgs>::value, |
"do not bind functions with nonconst ref"); |
const bool is_method = internal::HasIsMethodTag<RunnableType>::value; |