File indexing completed on 2025-01-18 09:41:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 namespace boost { namespace mpl { namespace aux {
0013 template< int N > struct arity_tag
0014 {
0015 typedef char (&type)[(unsigned)N + 1];
0016 };
0017
0018 template<
0019 int C1, int C2, int C3, int C4, int C5, int C6
0020 >
0021 struct max_arity
0022 {
0023 BOOST_STATIC_CONSTANT(int, value =
0024 ( C6 > 0 ? C6 : ( C5 > 0 ? C5 : ( C4 > 0 ? C4 : ( C3 > 0 ? C3 : ( C2 > 0 ? C2 : ( C1 > 0 ? C1 : -1 ) ) ) ) ) )
0025 );
0026 };
0027
0028 arity_tag<0>::type arity_helper(...);
0029
0030 template<
0031 template< typename P1 > class F
0032 , typename T1
0033 >
0034 typename arity_tag<1>::type
0035 arity_helper(type_wrapper< F<T1> >, arity_tag<1>);
0036
0037 template<
0038 template< typename P1, typename P2 > class F
0039 , typename T1, typename T2
0040 >
0041 typename arity_tag<2>::type
0042 arity_helper(type_wrapper< F< T1,T2 > >, arity_tag<2>);
0043
0044 template<
0045 template< typename P1, typename P2, typename P3 > class F
0046 , typename T1, typename T2, typename T3
0047 >
0048 typename arity_tag<3>::type
0049 arity_helper(type_wrapper< F< T1,T2,T3 > >, arity_tag<3>);
0050
0051 template<
0052 template< typename P1, typename P2, typename P3, typename P4 > class F
0053 , typename T1, typename T2, typename T3, typename T4
0054 >
0055 typename arity_tag<4>::type
0056 arity_helper(type_wrapper< F< T1,T2,T3,T4 > >, arity_tag<4>);
0057
0058 template<
0059 template<
0060 typename P1, typename P2, typename P3, typename P4
0061 , typename P5
0062 >
0063 class F
0064 , typename T1, typename T2, typename T3, typename T4, typename T5
0065 >
0066 typename arity_tag<5>::type
0067 arity_helper(type_wrapper< F< T1,T2,T3,T4,T5 > >, arity_tag<5>);
0068
0069 template<
0070 template<
0071 typename P1, typename P2, typename P3, typename P4
0072 , typename P5, typename P6
0073 >
0074 class F
0075 , typename T1, typename T2, typename T3, typename T4, typename T5
0076 , typename T6
0077 >
0078 typename arity_tag<6>::type
0079 arity_helper(type_wrapper< F< T1,T2,T3,T4,T5,T6 > >, arity_tag<6>);
0080 template< typename F, int N >
0081 struct template_arity_impl
0082 {
0083 BOOST_STATIC_CONSTANT(int, value =
0084 sizeof(::boost::mpl::aux::arity_helper(type_wrapper<F>(), arity_tag<N>())) - 1
0085 );
0086 };
0087
0088 template< typename F >
0089 struct template_arity
0090 {
0091 BOOST_STATIC_CONSTANT(int, value = (
0092 max_arity< template_arity_impl< F,1 >::value, template_arity_impl< F,2 >::value, template_arity_impl< F,3 >::value, template_arity_impl< F,4 >::value, template_arity_impl< F,5 >::value, template_arity_impl< F,6 >::value >::value
0093 ));
0094 typedef mpl::int_<value> type;
0095 };
0096
0097 }}}