diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 21:03:03 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-23 21:03:03 +0000 |
commit | 74141d650ff040128a5e35ba8f721d96b08843a3 (patch) | |
tree | f7ed5d4de304c8ea938a971b143caf5f99918af0 | |
parent | 888fecc63c1020cbc3564e3b9308bc721d842149 (diff) | |
download | chromium_src-74141d650ff040128a5e35ba8f721d96b08843a3.zip chromium_src-74141d650ff040128a5e35ba8f721d96b08843a3.tar.gz chromium_src-74141d650ff040128a5e35ba8f721d96b08843a3.tar.bz2 |
Increase Bind/Callback Arity from 6 -> 11: These go to eleven.
This is only for a build time stress test only. I will revert back to 6 after getting the data.
11 allows for binding of 11 arguments to a function, and 10 arguments to
a method. 10 seemed like a nice round number to try (MSVC's tr1::bind() only supports 10).
Template Growth rate (n == arity):
bind.h: n
bind_internal.h: (n^2 + 20n)/2
bind_internal_win.h: n
callback.h: n
Template growth equation: (n^2 + 26n) / 2
Template growth: 96 -> 203 types
BUG=98542
TEST=try bots. Then we get to watch the bot cycle times.
Review URL: http://codereview.chromium.org/8682015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111410 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/bind.h | 438 | ||||
-rw-r--r-- | base/bind.h.pump | 2 | ||||
-rw-r--r-- | base/bind_internal.h | 3723 | ||||
-rw-r--r-- | base/bind_internal.h.pump | 2 | ||||
-rw-r--r-- | base/bind_internal_win.h | 285 | ||||
-rw-r--r-- | base/bind_internal_win.h.pump | 2 | ||||
-rw-r--r-- | base/callback.h | 343 | ||||
-rw-r--r-- | base/callback.h.pump | 2 |
8 files changed, 4792 insertions, 5 deletions
diff --git a/base/bind.h b/base/bind.h index 1637207..5c07fc0 100644 --- a/base/bind.h +++ b/base/bind.h @@ -410,6 +410,444 @@ Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); } +template <typename Functor, typename P1, typename P2, typename P3, typename P4, + typename P5, typename P6, typename P7> +internal::BindStateHolder< + internal::BindState< + typename internal::FunctorTraits<Functor>::RunnableType, + typename internal::FunctorTraits<Functor>::RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType)> > +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; + typedef typename internal::FunctorTraits<Functor>::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits<typename RunnableType::RunType> + BoundFunctorTraits; + + // 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. + COMPILE_ASSERT( + !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A2Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A3Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A4Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A5Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A6Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A7Type>::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag<RunnableType>::value || + !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || + !is_array<P1>::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + + return internal::MakeBindStateHolder( + new internal::BindState<RunnableType, RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType)>( + internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7)); +} + +template <typename Functor, typename P1, typename P2, typename P3, typename P4, + typename P5, typename P6, typename P7, typename P8> +internal::BindStateHolder< + internal::BindState< + typename internal::FunctorTraits<Functor>::RunnableType, + typename internal::FunctorTraits<Functor>::RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType)> > +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7, const P8& p8) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; + typedef typename internal::FunctorTraits<Functor>::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits<typename RunnableType::RunType> + BoundFunctorTraits; + + // 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. + COMPILE_ASSERT( + !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A2Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A3Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A4Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A5Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A6Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A7Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A8Type>::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag<RunnableType>::value || + !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || + !is_array<P1>::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P8>::value, + p8_is_refcounted_type_and_needs_scoped_refptr); + + return internal::MakeBindStateHolder( + new internal::BindState<RunnableType, RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType)>( + internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7, p8)); +} + +template <typename Functor, typename P1, typename P2, typename P3, typename P4, + typename P5, typename P6, typename P7, typename P8, typename P9> +internal::BindStateHolder< + internal::BindState< + typename internal::FunctorTraits<Functor>::RunnableType, + typename internal::FunctorTraits<Functor>::RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType, + typename internal::CallbackParamTraits<P9>::StorageType)> > +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7, const P8& p8, const P9& p9) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; + typedef typename internal::FunctorTraits<Functor>::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits<typename RunnableType::RunType> + BoundFunctorTraits; + + // 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. + COMPILE_ASSERT( + !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A2Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A3Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A4Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A5Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A6Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A7Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A8Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A9Type>::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag<RunnableType>::value || + !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || + !is_array<P1>::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P8>::value, + p8_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P9>::value, + p9_is_refcounted_type_and_needs_scoped_refptr); + + return internal::MakeBindStateHolder( + new internal::BindState<RunnableType, RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType, + typename internal::CallbackParamTraits<P9>::StorageType)>( + internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7, p8, p9)); +} + +template <typename Functor, typename P1, typename P2, typename P3, typename P4, + typename P5, typename P6, typename P7, typename P8, typename P9, + typename P10> +internal::BindStateHolder< + internal::BindState< + typename internal::FunctorTraits<Functor>::RunnableType, + typename internal::FunctorTraits<Functor>::RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType, + typename internal::CallbackParamTraits<P9>::StorageType, + typename internal::CallbackParamTraits<P10>::StorageType)> > +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7, const P8& p8, const P9& p9, + const P10& p10) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; + typedef typename internal::FunctorTraits<Functor>::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits<typename RunnableType::RunType> + BoundFunctorTraits; + + // 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. + COMPILE_ASSERT( + !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A2Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A3Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A4Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A5Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A6Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A7Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A8Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A9Type>::value || + + is_non_const_reference<typename BoundFunctorTraits::A10Type>::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag<RunnableType>::value || + !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || + !is_array<P1>::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P8>::value, + p8_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P9>::value, + p9_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P10>::value, + p10_is_refcounted_type_and_needs_scoped_refptr); + + return internal::MakeBindStateHolder( + new internal::BindState<RunnableType, RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType, + typename internal::CallbackParamTraits<P9>::StorageType, + typename internal::CallbackParamTraits<P10>::StorageType)>( + internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7, p8, p9, + p10)); +} + +template <typename Functor, typename P1, typename P2, typename P3, typename P4, + typename P5, typename P6, typename P7, typename P8, typename P9, + typename P10, typename P11> +internal::BindStateHolder< + internal::BindState< + typename internal::FunctorTraits<Functor>::RunnableType, + typename internal::FunctorTraits<Functor>::RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType, + typename internal::CallbackParamTraits<P9>::StorageType, + typename internal::CallbackParamTraits<P10>::StorageType, + typename internal::CallbackParamTraits<P11>::StorageType)> > +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7, const P8& p8, const P9& p9, + const P10& p10, const P11& p11) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits<Functor>::RunnableType RunnableType; + typedef typename internal::FunctorTraits<Functor>::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits<typename RunnableType::RunType> + BoundFunctorTraits; + + // 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. + COMPILE_ASSERT( + !(is_non_const_reference<typename BoundFunctorTraits::A1Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A2Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A3Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A4Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A5Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A6Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A7Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A8Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A9Type>::value || + is_non_const_reference<typename BoundFunctorTraits::A10Type>::value + || is_non_const_reference<typename + BoundFunctorTraits::A11Type>::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag<RunnableType>::value || + !internal::NeedsScopedRefptrButGetsRawPtr<P1>::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag<RunnableType>::value || + !is_array<P1>::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P2>::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P3>::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P4>::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P5>::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P6>::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P7>::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P8>::value, + p8_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P9>::value, + p9_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P10>::value, + p10_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr<P11>::value, + p11_is_refcounted_type_and_needs_scoped_refptr); + + return internal::MakeBindStateHolder( + new internal::BindState<RunnableType, RunType, + void(typename internal::CallbackParamTraits<P1>::StorageType, + typename internal::CallbackParamTraits<P2>::StorageType, + typename internal::CallbackParamTraits<P3>::StorageType, + typename internal::CallbackParamTraits<P4>::StorageType, + typename internal::CallbackParamTraits<P5>::StorageType, + typename internal::CallbackParamTraits<P6>::StorageType, + typename internal::CallbackParamTraits<P7>::StorageType, + typename internal::CallbackParamTraits<P8>::StorageType, + typename internal::CallbackParamTraits<P9>::StorageType, + typename internal::CallbackParamTraits<P10>::StorageType, + typename internal::CallbackParamTraits<P11>::StorageType)>( + internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, p7, p8, p9, + p10, p11)); +} + } // namespace base #endif // BASE_BIND_H_ diff --git a/base/bind.h.pump b/base/bind.h.pump index 11b4667..92ed920 100644 --- a/base/bind.h.pump +++ b/base/bind.h.pump @@ -5,7 +5,7 @@ $$ $$ http://code.google.com/p/googletest/wiki/PumpManual $$ -$var MAX_ARITY = 6 +$var MAX_ARITY = 11 // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be diff --git a/base/bind_internal.h b/base/bind_internal.h index 6c76d80..1187760 100644 --- a/base/bind_internal.h +++ b/base/bind_internal.h @@ -552,6 +552,437 @@ class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6) const> { R (T::*method_)(A1, A2, A3, A4, A5, A6) const; }; +// Function: Arity 7. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// Method: Arity 7. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7)> { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// Const Method: Arity 7. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7) const> { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7) const; +}; + +// Function: Arity 8. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7, A8)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7, A8)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7, A8); +}; + +// Method: Arity 8. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8)> { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7, A8); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8); +}; + +// Const Method: Arity 8. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8) const> { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7, A8); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8) const; +}; + +// Function: Arity 9. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9); +}; + +// Method: Arity 9. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7, A8, A9); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8, A9); +}; + +// Const Method: Arity 9. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const> { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7, A8, A9); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8, + A9) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const; +}; + +// Function: Arity 10. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); +}; + +// Method: Arity 10. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9, typename A10> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); +}; + +// Const Method: Arity 10. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9, typename A10> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const> { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const; +}; + +// Function: Arity 11. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +class RunnableAdapter<R(*)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10, A11)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10, + typename CallbackParamTraits<A11>::ForwardType a11) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); +}; + +// Method: Arity 11. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9, typename A10, typename A11> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10, A11)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10, + typename CallbackParamTraits<A11>::ForwardType a11) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); +}; + +// Const Method: Arity 11. +template <typename R, typename T, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9, typename A10, typename A11> +class RunnableAdapter<R(T::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, + A11) const> { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10, A11) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10, + typename CallbackParamTraits<A11>::ForwardType a11) { + return (object->*method_)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const; +}; + // FunctionTraits<> // @@ -617,6 +1048,83 @@ struct FunctionTraits<R(A1, A2, A3, A4, A5, A6)> { typedef A6 A6Type; }; +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7)> { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7, A8)> { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; + typedef A8 A8Type; +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; + typedef A8 A8Type; + typedef A9 A9Type; +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; + typedef A8 A8Type; + typedef A9 A9Type; + typedef A10 A10Type; +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +struct FunctionTraits<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; + typedef A8 A8Type; + typedef A9 A9Type; + typedef A10 A10Type; + typedef A11 A11Type; +}; + // ForceVoidReturn<> // @@ -661,6 +1169,38 @@ struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6)> { typedef void(RunType)(A1, A2, A3, A4, A5, A6); }; +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6, A7)> { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7); +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6, A7, A8)> { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7, A8); +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9); +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +struct ForceVoidReturn<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); +}; + // FunctorTraits<> // @@ -924,6 +1464,185 @@ struct InvokeHelper<true, void, Runnable, } }; +template <typename ReturnType, typename Runnable,typename A1, typename A2, + typename A3, typename A4, typename A5, typename A6, typename A7> +struct InvokeHelper<false, ReturnType, Runnable, + void(A1, A2, A3, A4, A5, A6, A7)> { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7) { + return runnable.Run(a1, a2, a3, a4, a5, a6, a7); + } +}; + +template <typename Runnable,typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +struct InvokeHelper<false, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7) { + runnable.Run(a1, a2, a3, a4, a5, a6, a7); + } +}; + +template <typename Runnable, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7> +struct InvokeHelper<true, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7) { + if (!a1.get()) { + return; + } + + runnable.Run(a1, a2, a3, a4, a5, a6, a7); + } +}; + +template <typename ReturnType, typename Runnable,typename A1, typename A2, + typename A3, typename A4, typename A5, typename A6, typename A7, + typename A8> +struct InvokeHelper<false, ReturnType, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8)> { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7, A8 a8) { + return runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8); + } +}; + +template <typename Runnable,typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +struct InvokeHelper<false, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8) { + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8); + } +}; + +template <typename Runnable, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8> +struct InvokeHelper<true, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8) { + if (!a1.get()) { + return; + } + + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8); + } +}; + +template <typename ReturnType, typename Runnable,typename A1, typename A2, + typename A3, typename A4, typename A5, typename A6, typename A7, + typename A8, typename A9> +struct InvokeHelper<false, ReturnType, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { + return runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } +}; + +template <typename Runnable,typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +struct InvokeHelper<false, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8, A9 a9) { + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } +}; + +template <typename Runnable, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9> +struct InvokeHelper<true, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8, A9 a9) { + if (!a1.get()) { + return; + } + + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } +}; + +template <typename ReturnType, typename Runnable,typename A1, typename A2, + typename A3, typename A4, typename A5, typename A6, typename A7, + typename A8, typename A9, typename A10> +struct InvokeHelper<false, ReturnType, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) { + return runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } +}; + +template <typename Runnable,typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +struct InvokeHelper<false, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) { + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } +}; + +template <typename Runnable, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9, typename A10> +struct InvokeHelper<true, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8, A9 a9, A10 a10) { + if (!a1.get()) { + return; + } + + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } +}; + +template <typename ReturnType, typename Runnable,typename A1, typename A2, + typename A3, typename A4, typename A5, typename A6, typename A7, + typename A8, typename A9, typename A10, typename A11> +struct InvokeHelper<false, ReturnType, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, A10 a10, A11 a11) { + return runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } +}; + +template <typename Runnable,typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +struct InvokeHelper<false, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8, A9 a9, A10 a10, A11 a11) { + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } +}; + +template <typename Runnable, typename A1, typename A2, typename A3, + typename A4, typename A5, typename A6, typename A7, typename A8, + typename A9, typename A10, typename A11> +struct InvokeHelper<true, void, Runnable, + void(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)> { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7, A8 a8, A9 a9, A10 a10, A11 a11) { + if (!a1.get()) { + return; + } + + runnable.Run(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } +}; + #if !defined(_MSC_VER) template <typename ReturnType, typename Runnable, typename ArgsType> @@ -1918,6 +2637,2753 @@ struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { } }; +// Arity 7 -> 7. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X1>::ForwardType, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 6. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 5. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 4. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 3. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 2. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 1. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X7>::ForwardType); + + typedef R(UnboundRunType)(X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X7>::ForwardType x7) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename CallbackParamTraits<X7>::ForwardType x7)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 7 -> 0. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7> +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7); + } +}; + +// Arity 8 -> 8. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X1>::ForwardType, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 7. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 6. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 5. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 4. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 3. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X6, X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 2. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X7, X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 1. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X8>::ForwardType); + + typedef R(UnboundRunType)(X8); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X8>::ForwardType x8) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename CallbackParamTraits<X8>::ForwardType x8)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 8 -> 0. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8> +struct Invoker<8, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8); + } +}; + +// Arity 9 -> 9. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X1>::ForwardType, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 8. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 7. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 6. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 5. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 4. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X6, X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 3. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X7, X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 2. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X8, X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 1. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<8, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X9>::ForwardType); + + typedef R(UnboundRunType)(X9); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X9>::ForwardType x9) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename CallbackParamTraits<X9>::ForwardType x9)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 9 -> 0. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9> +struct Invoker<9, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + typedef typename StorageType::Bound9UnwrapTraits Bound9UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + typename Bound9UnwrapTraits::ForwardType x9 = + Bound9UnwrapTraits::Unwrap(storage->p9_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename Bound9UnwrapTraits::ForwardType)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9); + } +}; + +// Arity 10 -> 10. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X1>::ForwardType, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 9. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 8. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 7. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 6. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 5. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X6, X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 4. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X7, X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 3. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X8, X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 2. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<8, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X9, X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 1. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<9, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X10>::ForwardType); + + typedef R(UnboundRunType)(X10); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X10>::ForwardType x10) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + typedef typename StorageType::Bound9UnwrapTraits Bound9UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + typename Bound9UnwrapTraits::ForwardType x9 = + Bound9UnwrapTraits::Unwrap(storage->p9_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename Bound9UnwrapTraits::ForwardType, + typename CallbackParamTraits<X10>::ForwardType x10)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 10 -> 0. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10> +struct Invoker<10, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + typedef typename StorageType::Bound9UnwrapTraits Bound9UnwrapTraits; + typedef typename StorageType::Bound10UnwrapTraits Bound10UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + typename Bound9UnwrapTraits::ForwardType x9 = + Bound9UnwrapTraits::Unwrap(storage->p9_); + typename Bound10UnwrapTraits::ForwardType x10 = + Bound10UnwrapTraits::Unwrap(storage->p10_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename Bound9UnwrapTraits::ForwardType, + typename Bound10UnwrapTraits::ForwardType)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10); + } +}; + +// Arity 11 -> 11. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X1>::ForwardType, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename CallbackParamTraits<X1>::ForwardType x1, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 10. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X2>::ForwardType, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename CallbackParamTraits<X2>::ForwardType x2, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 9. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X3>::ForwardType, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename CallbackParamTraits<X3>::ForwardType x3, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 8. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X4>::ForwardType, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename CallbackParamTraits<X4>::ForwardType x4, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 7. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X5>::ForwardType, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename CallbackParamTraits<X5>::ForwardType x5, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 6. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X6>::ForwardType, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X6, X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename CallbackParamTraits<X6>::ForwardType x6, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 5. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X7>::ForwardType, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X7, X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename CallbackParamTraits<X7>::ForwardType x7, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 4. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X8>::ForwardType, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X8, X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename CallbackParamTraits<X8>::ForwardType x8, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 3. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<8, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X9>::ForwardType, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X9, X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename CallbackParamTraits<X9>::ForwardType x9, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 2. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<9, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X10>::ForwardType, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X10, X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + typedef typename StorageType::Bound9UnwrapTraits Bound9UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + typename Bound9UnwrapTraits::ForwardType x9 = + Bound9UnwrapTraits::Unwrap(storage->p9_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename Bound9UnwrapTraits::ForwardType, + typename CallbackParamTraits<X10>::ForwardType x10, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 1. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<10, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits<X11>::ForwardType); + + typedef R(UnboundRunType)(X11); + + static R Run(BindStateBase* base, + typename CallbackParamTraits<X11>::ForwardType x11) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + typedef typename StorageType::Bound9UnwrapTraits Bound9UnwrapTraits; + typedef typename StorageType::Bound10UnwrapTraits Bound10UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + typename Bound9UnwrapTraits::ForwardType x9 = + Bound9UnwrapTraits::Unwrap(storage->p9_); + typename Bound10UnwrapTraits::ForwardType x10 = + Bound10UnwrapTraits::Unwrap(storage->p10_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename Bound9UnwrapTraits::ForwardType, + typename Bound10UnwrapTraits::ForwardType, + typename CallbackParamTraits<X11>::ForwardType x11)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + +// Arity 11 -> 0. +template <typename StorageType, typename R,typename X1, typename X2, + typename X3, typename X4, typename X5, typename X6, typename X7, + typename X8, typename X9, typename X10, typename X11> +struct Invoker<11, StorageType, R(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, + X11)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast<StorageType*>(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + typedef typename StorageType::Bound8UnwrapTraits Bound8UnwrapTraits; + typedef typename StorageType::Bound9UnwrapTraits Bound9UnwrapTraits; + typedef typename StorageType::Bound10UnwrapTraits Bound10UnwrapTraits; + typedef typename StorageType::Bound11UnwrapTraits Bound11UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + typename Bound8UnwrapTraits::ForwardType x8 = + Bound8UnwrapTraits::Unwrap(storage->p8_); + typename Bound9UnwrapTraits::ForwardType x9 = + Bound9UnwrapTraits::Unwrap(storage->p9_); + typename Bound10UnwrapTraits::ForwardType x10 = + Bound10UnwrapTraits::Unwrap(storage->p10_); + typename Bound11UnwrapTraits::ForwardType x11 = + Bound11UnwrapTraits::Unwrap(storage->p11_); + return InvokeHelper<StorageType::IsWeakCall::value, R, + typename StorageType::RunnableType, + void(typename Bound1UnwrapTraits::ForwardType, + typename Bound2UnwrapTraits::ForwardType, + typename Bound3UnwrapTraits::ForwardType, + typename Bound4UnwrapTraits::ForwardType, + typename Bound5UnwrapTraits::ForwardType, + typename Bound6UnwrapTraits::ForwardType, + typename Bound7UnwrapTraits::ForwardType, + typename Bound8UnwrapTraits::ForwardType, + typename Bound9UnwrapTraits::ForwardType, + typename Bound10UnwrapTraits::ForwardType, + typename Bound11UnwrapTraits::ForwardType)> + ::MakeItSo(storage->runnable_, x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11); + } +}; + // BindState<> // @@ -2142,6 +5608,263 @@ struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6 p6_; }; +template <typename Runnable, typename RunType, typename P1, typename P2, + typename P3, typename P4, typename P5, typename P6, typename P7> +struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, + P7)> : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; + typedef Invoker<7, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits<P1> Bound1UnwrapTraits; + typedef UnwrapTraits<P2> Bound2UnwrapTraits; + typedef UnwrapTraits<P3> Bound3UnwrapTraits; + typedef UnwrapTraits<P4> Bound4UnwrapTraits; + typedef UnwrapTraits<P5> Bound5UnwrapTraits; + typedef UnwrapTraits<P6> Bound6UnwrapTraits; + typedef UnwrapTraits<P7> Bound7UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7) { + MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; +}; + +template <typename Runnable, typename RunType, typename P1, typename P2, + typename P3, typename P4, typename P5, typename P6, typename P7, + typename P8> +struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, P7, + P8)> : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; + typedef Invoker<8, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits<P1> Bound1UnwrapTraits; + typedef UnwrapTraits<P2> Bound2UnwrapTraits; + typedef UnwrapTraits<P3> Bound3UnwrapTraits; + typedef UnwrapTraits<P4> Bound4UnwrapTraits; + typedef UnwrapTraits<P5> Bound5UnwrapTraits; + typedef UnwrapTraits<P6> Bound6UnwrapTraits; + typedef UnwrapTraits<P7> Bound7UnwrapTraits; + typedef UnwrapTraits<P8> Bound8UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7), + p8_(p8) { + MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; + P8 p8_; +}; + +template <typename Runnable, typename RunType, typename P1, typename P2, + typename P3, typename P4, typename P5, typename P6, typename P7, + typename P8, typename P9> +struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, P7, P8, + P9)> : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; + typedef Invoker<9, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits<P1> Bound1UnwrapTraits; + typedef UnwrapTraits<P2> Bound2UnwrapTraits; + typedef UnwrapTraits<P3> Bound3UnwrapTraits; + typedef UnwrapTraits<P4> Bound4UnwrapTraits; + typedef UnwrapTraits<P5> Bound5UnwrapTraits; + typedef UnwrapTraits<P6> Bound6UnwrapTraits; + typedef UnwrapTraits<P7> Bound7UnwrapTraits; + typedef UnwrapTraits<P8> Bound8UnwrapTraits; + typedef UnwrapTraits<P9> Bound9UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8, + const P9& p9) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7), + p8_(p8), + p9_(p9) { + MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; + P8 p8_; + P9 p9_; +}; + +template <typename Runnable, typename RunType, typename P1, typename P2, + typename P3, typename P4, typename P5, typename P6, typename P7, + typename P8, typename P9, typename P10> +struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, P7, P8, P9, + P10)> : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; + typedef Invoker<10, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits<P1> Bound1UnwrapTraits; + typedef UnwrapTraits<P2> Bound2UnwrapTraits; + typedef UnwrapTraits<P3> Bound3UnwrapTraits; + typedef UnwrapTraits<P4> Bound4UnwrapTraits; + typedef UnwrapTraits<P5> Bound5UnwrapTraits; + typedef UnwrapTraits<P6> Bound6UnwrapTraits; + typedef UnwrapTraits<P7> Bound7UnwrapTraits; + typedef UnwrapTraits<P8> Bound8UnwrapTraits; + typedef UnwrapTraits<P9> Bound9UnwrapTraits; + typedef UnwrapTraits<P10> Bound10UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8, + const P9& p9, const P10& p10) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7), + p8_(p8), + p9_(p9), + p10_(p10) { + MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; + P8 p8_; + P9 p9_; + P10 p10_; +}; + +template <typename Runnable, typename RunType, typename P1, typename P2, + typename P3, typename P4, typename P5, typename P6, typename P7, + typename P8, typename P9, typename P10, typename P11> +struct BindState<Runnable, RunType, void(P1, P2, P3, P4, P5, P6, P7, P8, P9, + P10, P11)> : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod<HasIsMethodTag<Runnable>::value, P1> IsWeakCall; + typedef Invoker<11, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits<P1> Bound1UnwrapTraits; + typedef UnwrapTraits<P2> Bound2UnwrapTraits; + typedef UnwrapTraits<P3> Bound3UnwrapTraits; + typedef UnwrapTraits<P4> Bound4UnwrapTraits; + typedef UnwrapTraits<P5> Bound5UnwrapTraits; + typedef UnwrapTraits<P6> Bound6UnwrapTraits; + typedef UnwrapTraits<P7> Bound7UnwrapTraits; + typedef UnwrapTraits<P8> Bound8UnwrapTraits; + typedef UnwrapTraits<P9> Bound9UnwrapTraits; + typedef UnwrapTraits<P10> Bound10UnwrapTraits; + typedef UnwrapTraits<P11> Bound11UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7, const P8& p8, + const P9& p9, const P10& p10, const P11& p11) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7), + p8_(p8), + p9_(p9), + p10_(p10), + p11_(p11) { + MaybeRefcount<HasIsMethodTag<Runnable>::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount<HasIsMethodTag<Runnable>::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; + P8 p8_; + P9 p9_; + P10 p10_; + P11 p11_; +}; + } // namespace internal } // namespace base diff --git a/base/bind_internal.h.pump b/base/bind_internal.h.pump index 1192974..0459897 100644 --- a/base/bind_internal.h.pump +++ b/base/bind_internal.h.pump @@ -11,7 +11,7 @@ $$ // // Do we want to allow creating a fully unbound method?? -$var MAX_ARITY = 6 +$var MAX_ARITY = 11 $range ARITY 0..MAX_ARITY // Copyright (c) 2011 The Chromium Authors. All rights reserved. diff --git a/base/bind_internal_win.h b/base/bind_internal_win.h index 17d3aa3..1adcd00 100644 --- a/base/bind_internal_win.h +++ b/base/bind_internal_win.h @@ -312,6 +312,291 @@ class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> { R (__fastcall *function_)(A1, A2, A3, A4, A5, A6); }; +// __stdcall Function: Arity 7. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// __fastcall Function: Arity 7. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// __stdcall Function: Arity 8. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7, A8)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8); +}; + +// __fastcall Function: Arity 8. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7, A8)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8); +}; + +// __stdcall Function: Arity 9. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8, A9)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9); +}; + +// __fastcall Function: Arity 9. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8, A9)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9); +}; + +// __stdcall Function: Arity 10. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8, A9, A10)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); +}; + +// __fastcall Function: Arity 10. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8, A9, A10)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); +}; + +// __stdcall Function: Arity 11. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, + A11)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8, A9, A10, A11)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10, + typename CallbackParamTraits<A11>::ForwardType a11) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); +}; + +// __fastcall Function: Arity 11. +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, + A11)> { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7, + A8, A9, A10, A11)) + : function_(function) { + } + + R Run(typename CallbackParamTraits<A1>::ForwardType a1, + typename CallbackParamTraits<A2>::ForwardType a2, + typename CallbackParamTraits<A3>::ForwardType a3, + typename CallbackParamTraits<A4>::ForwardType a4, + typename CallbackParamTraits<A5>::ForwardType a5, + typename CallbackParamTraits<A6>::ForwardType a6, + typename CallbackParamTraits<A7>::ForwardType a7, + typename CallbackParamTraits<A8>::ForwardType a8, + typename CallbackParamTraits<A9>::ForwardType a9, + typename CallbackParamTraits<A10>::ForwardType a10, + typename CallbackParamTraits<A11>::ForwardType a11) { + return function_(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); +}; + } // namespace internal } // namespace base diff --git a/base/bind_internal_win.h.pump b/base/bind_internal_win.h.pump index 1d3b6b4..19463bc 100644 --- a/base/bind_internal_win.h.pump +++ b/base/bind_internal_win.h.pump @@ -5,7 +5,7 @@ $$ $$ http://code.google.com/p/googletest/wiki/PumpManual $$ -$var MAX_ARITY = 6 +$var MAX_ARITY = 11 // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be diff --git a/base/callback.h b/base/callback.h index 6844cc5..7c85339 100644 --- a/base/callback.h +++ b/base/callback.h @@ -227,7 +227,7 @@ namespace base { // compiler that the template only has 1 type parameter which is the function // signature that the Callback is representing. // -// After this, create template specializations for 0-6 parameters. Note that +// After this, create template specializations for 0-11 parameters. Note that // even though the template typelist grows, the specialization still // only has one type: the function signature. template <typename Sig> @@ -573,6 +573,347 @@ class Callback<R(A1, A2, A3, A4, A5, A6)> : public internal::CallbackBase { }; +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7> +class Callback<R(A1, A2, A3, A4, A5, A6, A7)> : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); + + Callback() : CallbackBase(NULL, NULL) { } + + // We pass BindStateHolder by const ref to avoid incurring an + // unnecessary AddRef/Unref pair even though we will modify the object. + // We cannot use a normal reference because the compiler will warn + // since this is often used on a return value, which is a temporary. + // + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template <typename T> + Callback(const internal::BindStateHolder<T>& bind_state_holder) + : CallbackBase(NULL, &bind_state_holder.bind_state_) { + // Force the assignment to a location variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = &T::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, + typename internal::CallbackParamTraits<A2>::ForwardType a2, + typename internal::CallbackParamTraits<A3>::ForwardType a3, + typename internal::CallbackParamTraits<A4>::ForwardType a4, + typename internal::CallbackParamTraits<A5>::ForwardType a5, + typename internal::CallbackParamTraits<A6>::ForwardType a6, + typename internal::CallbackParamTraits<A7>::ForwardType a7) const { + PolymorphicInvoke f = + reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); + + return f(bind_state_.get(), a1, + a2, + a3, + a4, + a5, + a6, + a7); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits<A1>::ForwardType, + typename internal::CallbackParamTraits<A2>::ForwardType, + typename internal::CallbackParamTraits<A3>::ForwardType, + typename internal::CallbackParamTraits<A4>::ForwardType, + typename internal::CallbackParamTraits<A5>::ForwardType, + typename internal::CallbackParamTraits<A6>::ForwardType, + typename internal::CallbackParamTraits<A7>::ForwardType); + +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8> +class Callback<R(A1, A2, A3, A4, A5, A6, A7, + A8)> : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7, A8); + + Callback() : CallbackBase(NULL, NULL) { } + + // We pass BindStateHolder by const ref to avoid incurring an + // unnecessary AddRef/Unref pair even though we will modify the object. + // We cannot use a normal reference because the compiler will warn + // since this is often used on a return value, which is a temporary. + // + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template <typename T> + Callback(const internal::BindStateHolder<T>& bind_state_holder) + : CallbackBase(NULL, &bind_state_holder.bind_state_) { + // Force the assignment to a location variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = &T::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, + typename internal::CallbackParamTraits<A2>::ForwardType a2, + typename internal::CallbackParamTraits<A3>::ForwardType a3, + typename internal::CallbackParamTraits<A4>::ForwardType a4, + typename internal::CallbackParamTraits<A5>::ForwardType a5, + typename internal::CallbackParamTraits<A6>::ForwardType a6, + typename internal::CallbackParamTraits<A7>::ForwardType a7, + typename internal::CallbackParamTraits<A8>::ForwardType a8) const { + PolymorphicInvoke f = + reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); + + return f(bind_state_.get(), a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits<A1>::ForwardType, + typename internal::CallbackParamTraits<A2>::ForwardType, + typename internal::CallbackParamTraits<A3>::ForwardType, + typename internal::CallbackParamTraits<A4>::ForwardType, + typename internal::CallbackParamTraits<A5>::ForwardType, + typename internal::CallbackParamTraits<A6>::ForwardType, + typename internal::CallbackParamTraits<A7>::ForwardType, + typename internal::CallbackParamTraits<A8>::ForwardType); + +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9> +class Callback<R(A1, A2, A3, A4, A5, A6, A7, A8, + A9)> : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9); + + Callback() : CallbackBase(NULL, NULL) { } + + // We pass BindStateHolder by const ref to avoid incurring an + // unnecessary AddRef/Unref pair even though we will modify the object. + // We cannot use a normal reference because the compiler will warn + // since this is often used on a return value, which is a temporary. + // + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template <typename T> + Callback(const internal::BindStateHolder<T>& bind_state_holder) + : CallbackBase(NULL, &bind_state_holder.bind_state_) { + // Force the assignment to a location variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = &T::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, + typename internal::CallbackParamTraits<A2>::ForwardType a2, + typename internal::CallbackParamTraits<A3>::ForwardType a3, + typename internal::CallbackParamTraits<A4>::ForwardType a4, + typename internal::CallbackParamTraits<A5>::ForwardType a5, + typename internal::CallbackParamTraits<A6>::ForwardType a6, + typename internal::CallbackParamTraits<A7>::ForwardType a7, + typename internal::CallbackParamTraits<A8>::ForwardType a8, + typename internal::CallbackParamTraits<A9>::ForwardType a9) const { + PolymorphicInvoke f = + reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); + + return f(bind_state_.get(), a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits<A1>::ForwardType, + typename internal::CallbackParamTraits<A2>::ForwardType, + typename internal::CallbackParamTraits<A3>::ForwardType, + typename internal::CallbackParamTraits<A4>::ForwardType, + typename internal::CallbackParamTraits<A5>::ForwardType, + typename internal::CallbackParamTraits<A6>::ForwardType, + typename internal::CallbackParamTraits<A7>::ForwardType, + typename internal::CallbackParamTraits<A8>::ForwardType, + typename internal::CallbackParamTraits<A9>::ForwardType); + +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10> +class Callback<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10)> : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); + + Callback() : CallbackBase(NULL, NULL) { } + + // We pass BindStateHolder by const ref to avoid incurring an + // unnecessary AddRef/Unref pair even though we will modify the object. + // We cannot use a normal reference because the compiler will warn + // since this is often used on a return value, which is a temporary. + // + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template <typename T> + Callback(const internal::BindStateHolder<T>& bind_state_holder) + : CallbackBase(NULL, &bind_state_holder.bind_state_) { + // Force the assignment to a location variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = &T::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, + typename internal::CallbackParamTraits<A2>::ForwardType a2, + typename internal::CallbackParamTraits<A3>::ForwardType a3, + typename internal::CallbackParamTraits<A4>::ForwardType a4, + typename internal::CallbackParamTraits<A5>::ForwardType a5, + typename internal::CallbackParamTraits<A6>::ForwardType a6, + typename internal::CallbackParamTraits<A7>::ForwardType a7, + typename internal::CallbackParamTraits<A8>::ForwardType a8, + typename internal::CallbackParamTraits<A9>::ForwardType a9, + typename internal::CallbackParamTraits<A10>::ForwardType a10) const { + PolymorphicInvoke f = + reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); + + return f(bind_state_.get(), a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits<A1>::ForwardType, + typename internal::CallbackParamTraits<A2>::ForwardType, + typename internal::CallbackParamTraits<A3>::ForwardType, + typename internal::CallbackParamTraits<A4>::ForwardType, + typename internal::CallbackParamTraits<A5>::ForwardType, + typename internal::CallbackParamTraits<A6>::ForwardType, + typename internal::CallbackParamTraits<A7>::ForwardType, + typename internal::CallbackParamTraits<A8>::ForwardType, + typename internal::CallbackParamTraits<A9>::ForwardType, + typename internal::CallbackParamTraits<A10>::ForwardType); + +}; + +template <typename R, typename A1, typename A2, typename A3, typename A4, + typename A5, typename A6, typename A7, typename A8, typename A9, + typename A10, typename A11> +class Callback<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, + A11)> : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); + + Callback() : CallbackBase(NULL, NULL) { } + + // We pass BindStateHolder by const ref to avoid incurring an + // unnecessary AddRef/Unref pair even though we will modify the object. + // We cannot use a normal reference because the compiler will warn + // since this is often used on a return value, which is a temporary. + // + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template <typename T> + Callback(const internal::BindStateHolder<T>& bind_state_holder) + : CallbackBase(NULL, &bind_state_holder.bind_state_) { + // Force the assignment to a location variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = &T::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast<InvokeFuncStorage>(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits<A1>::ForwardType a1, + typename internal::CallbackParamTraits<A2>::ForwardType a2, + typename internal::CallbackParamTraits<A3>::ForwardType a3, + typename internal::CallbackParamTraits<A4>::ForwardType a4, + typename internal::CallbackParamTraits<A5>::ForwardType a5, + typename internal::CallbackParamTraits<A6>::ForwardType a6, + typename internal::CallbackParamTraits<A7>::ForwardType a7, + typename internal::CallbackParamTraits<A8>::ForwardType a8, + typename internal::CallbackParamTraits<A9>::ForwardType a9, + typename internal::CallbackParamTraits<A10>::ForwardType a10, + typename internal::CallbackParamTraits<A11>::ForwardType a11) const { + PolymorphicInvoke f = + reinterpret_cast<PolymorphicInvoke>(polymorphic_invoke_); + + return f(bind_state_.get(), a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10, + a11); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits<A1>::ForwardType, + typename internal::CallbackParamTraits<A2>::ForwardType, + typename internal::CallbackParamTraits<A3>::ForwardType, + typename internal::CallbackParamTraits<A4>::ForwardType, + typename internal::CallbackParamTraits<A5>::ForwardType, + typename internal::CallbackParamTraits<A6>::ForwardType, + typename internal::CallbackParamTraits<A7>::ForwardType, + typename internal::CallbackParamTraits<A8>::ForwardType, + typename internal::CallbackParamTraits<A9>::ForwardType, + typename internal::CallbackParamTraits<A10>::ForwardType, + typename internal::CallbackParamTraits<A11>::ForwardType); + +}; + // Syntactic sugar to make Callbacks<void(void)> easier to declare since it // will be used in a lot of APIs with delayed execution. diff --git a/base/callback.h.pump b/base/callback.h.pump index eee3371..04b746f 100644 --- a/base/callback.h.pump +++ b/base/callback.h.pump @@ -5,7 +5,7 @@ $$ $$ http://code.google.com/p/googletest/wiki/PumpManual $$ -$var MAX_ARITY = 6 +$var MAX_ARITY = 11 // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be |