- template<typename Traits>
- struct get_arg9_type<true, Traits>
- {
- typedef typename Traits::arg9_type type;
- };
-
- template<bool GetIt, typename Traits>
- struct get_arg10_type
- {
- typedef unusable type;
- };
-
- template<typename Traits>
- struct get_arg10_type<true, Traits>
- {
- typedef typename Traits::arg10_type type;
- };
-
- template<int X, int Y>
- struct gte
- {
- BOOST_STATIC_CONSTANT(bool, value = (X >= Y));
- };
-
- template<bool IsFunction,
- typename InR,
- typename InT1,
- typename InT2,
- typename InT3,
- typename InT4,
- typename InT5,
- typename InT6,
- typename InT7,
- typename InT8,
- typename InT9,
- typename InT10,
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- typename InPolicy,
- typename InMixin,
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- typename InAllocator>
- struct maybe_decode_function_args
- {
- typedef function_traits<InR> traits;
-
- typedef typename traits::result_type R;
- typedef typename get_arg1_type<(gte<(traits::arity), 1>::value),
- traits>::type T1;
- typedef typename get_arg2_type<(gte<(traits::arity), 2>::value),
- traits>::type T2;
- typedef typename get_arg3_type<(gte<(traits::arity), 3>::value),
- traits>::type T3;
- typedef typename get_arg4_type<(gte<(traits::arity), 4>::value),
- traits>::type T4;
- typedef typename get_arg5_type<(gte<(traits::arity), 5>::value),
- traits>::type T5;
- typedef typename get_arg6_type<(gte<(traits::arity), 6>::value),
- traits>::type T6;
- typedef typename get_arg7_type<(gte<(traits::arity), 7>::value),
- traits>::type T7;
- typedef typename get_arg8_type<(gte<(traits::arity), 8>::value),
- traits>::type T8;
- typedef typename get_arg9_type<(gte<(traits::arity), 9>::value),
- traits>::type T9;
- typedef typename get_arg10_type<(gte<(traits::arity), 10>::value),
- traits>::type T10;
-
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- typedef typename ct_if<(is_same<InT1, unusable>::value),
- empty_function_policy,
- InT1>::type Policy;
- typedef typename ct_if<(is_same<InT2, unusable>::value),
- empty_function_mixin,
- InT2>::type Mixin;
- typedef typename ct_if<(is_same<InT3, unusable>::value),
- std::allocator<function_base>,
- InT3>::type Allocator;
-#else
- typedef typename ct_if<(is_same<InT1, unusable>::value),
- std::allocator<function_base>,
- InT1>::type Allocator;
-#endif // BOOST_FUNCTION_NO_DEPRECATED
- };
-
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- template<typename InR,
- typename InT1,
- typename InT2,
- typename InT3,
- typename InT4,
- typename InT5,
- typename InT6,
- typename InT7,
- typename InT8,
- typename InT9,
- typename InT10,
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- typename InPolicy,
- typename InMixin,
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- typename InAllocator>
- struct maybe_decode_function_args<false, InR, InT1, InT2, InT3, InT4,
- InT5, InT6, InT7, InT8, InT9, InT10,
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- InPolicy, InMixin,
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- InAllocator>
- {
- // Not a function, so just map the types directly
- typedef InR R;
- typedef InT1 T1;
- typedef InT2 T2;
- typedef InT3 T3;
- typedef InT4 T4;
- typedef InT5 T5;
- typedef InT6 T6;
- typedef InT7 T7;
- typedef InT8 T8;
- typedef InT9 T9;
- typedef InT10 T10;
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- typedef InPolicy Policy;
- typedef InMixin Mixin;
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- typedef InAllocator Allocator;
-
- };
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
-
-#endif // ndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
- template<
- typename InR,
- typename InT1,
- typename InT2,
- typename InT3,
- typename InT4,
- typename InT5,
- typename InT6,
- typename InT7,
- typename InT8,
- typename InT9,
- typename InT10,
- typename InPolicy = empty_function_policy,
- typename InMixin = empty_function_mixin,
- typename InAllocator = std::allocator<function_base>
- >
- struct get_function_impl
- {
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- typedef maybe_decode_function_args<(is_function<InR>::value),
- InR, InT1, InT2, InT3, InT4, InT5,
- InT6, InT7, InT8, InT9, InT10,
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- InPolicy, InMixin,
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- InAllocator> decoder;
- typedef typename decoder::R R;
- typedef typename decoder::T1 T1;
- typedef typename decoder::T2 T2;
- typedef typename decoder::T3 T3;
- typedef typename decoder::T4 T4;
- typedef typename decoder::T5 T5;
- typedef typename decoder::T6 T6;
- typedef typename decoder::T7 T7;
- typedef typename decoder::T8 T8;
- typedef typename decoder::T9 T9;
- typedef typename decoder::T10 T10;
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- typedef typename decoder::Policy Policy;
- typedef typename decoder::Mixin Mixin;
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- typedef typename decoder::Allocator Allocator;
-#else
- typedef InR R;
- typedef InT1 T1;
- typedef InT2 T2;
- typedef InT3 T3;
- typedef InT4 T4;
- typedef InT5 T5;
- typedef InT6 T6;
- typedef InT7 T7;
- typedef InT8 T8;
- typedef InT9 T9;
- typedef InT10 T10;
- typedef InPolicy Policy;
- typedef InMixin Mixin;
- typedef InAllocator Allocator;
-#endif // def BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
- typedef typename real_get_function_impl<
- (count_used_args<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value)
- >::template params<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- Policy, Mixin,
-#endif // ndef BOOST_FUNCTION_NO_DEPRECATED
- Allocator>::type
- type;
- };
-
-#ifndef BOOST_FUNCTION_NO_DEPRECATED
- template<
- typename InR,
- typename InT1,
- typename InT2,
- typename InT3,
- typename InT4,
- typename InT5,
- typename InT6,
- typename InT7,
- typename InT8,
- typename InT9,
- typename InT10,
- typename InMyPolicy = empty_function_policy,
- typename InMyMixin = empty_function_mixin,
- typename InMyAllocator = std::allocator<function_base>
- >
- class function_traits_builder
- {
- typedef get_function_impl<InR, InT1, InT2, InT3, InT4, InT5, InT6, InT7,
- InT8, InT9, InT10, InMyPolicy, InMyMixin,
- InMyAllocator>
- impl;
-
- typedef typename impl::R MyR;
- typedef typename impl::T1 MyT1;
- typedef typename impl::T2 MyT2;
- typedef typename impl::T3 MyT3;
- typedef typename impl::T4 MyT4;
- typedef typename impl::T5 MyT5;
- typedef typename impl::T6 MyT6;
- typedef typename impl::T7 MyT7;
- typedef typename impl::T8 MyT8;
- typedef typename impl::T9 MyT9;
- typedef typename impl::T10 MyT10;
- typedef typename impl::Policy MyPolicy;
- typedef typename impl::Mixin MyMixin;
- typedef typename impl::Allocator MyAllocator;
-
- public:
- typedef typename impl::type type;
- typedef MyPolicy policy_type;
- typedef MyMixin mixin_type;
- typedef MyAllocator allocator_type;
-
-#ifndef BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
- template<typename Policy>
- struct policy :
- public function_traits_builder<MyR, MyT1, MyT2, MyT3, MyT4, MyT5, MyT6,
- MyT7, MyT8, MyT9, MyT10, Policy,
- mixin_type, allocator_type> {};
-
- template<typename Mixin>
- struct mixin :
- public function_traits_builder<MyR, MyT1, MyT2, MyT3, MyT4, MyT5, MyT6,
- MyT7, MyT8, MyT9, MyT10, policy_type,
- Mixin, allocator_type> {};