File indexing completed on 2025-01-18 09:50:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
0012 #define BOOST_PROTO_DETAIL_TEMPLATE_ARITY_HPP_EAN_2011_05_07
0013
0014
0015
0016
0017 #define BOOST_PROTO_TEMPLATE_ARITY_PARAM BOOST_PROTO_TEMPLATE_ARITY_PARAM2
0018 #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param)
0019
0020 #if defined(BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) || \
0021 (defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES))
0022
0023 #include <boost/preprocessor/cat.hpp>
0024 #include <boost/preprocessor/inc.hpp>
0025 #include <boost/preprocessor/iteration/iterate.hpp>
0026 #include <boost/preprocessor/repetition/enum_params.hpp>
0027 #include <boost/mpl/int.hpp>
0028 #include <boost/proto/proto_fwd.hpp>
0029
0030 #undef BOOST_PROTO_TEMPLATE_ARITY_PARAM2
0031 #define BOOST_PROTO_TEMPLATE_ARITY_PARAM2(param) , param
0032
0033 namespace boost { namespace proto { namespace detail
0034 {
0035 sized_type<1>::type template_arity_helper(...);
0036
0037
0038 #include <boost/proto/detail/template_arity_helper.hpp>
0039
0040 template<typename F, int N, int Size>
0041 struct template_arity_impl2
0042 : mpl::int_<Size - 1>
0043 {};
0044
0045 template<typename F, int N = BOOST_PROTO_MAX_ARITY>
0046 struct template_arity
0047 : template_arity_impl2<
0048 F
0049 , N
0050 , sizeof(detail::template_arity_helper((F **)0, (mpl::int_<N> *)0))
0051 >
0052 {};
0053
0054 template<typename F, int N>
0055 struct template_arity_impl2<F, N, 1>
0056 : template_arity<F, N-1>
0057 {};
0058
0059 template<typename F>
0060 struct template_arity_impl2<F, 0, 1>
0061 : mpl::int_<-1>
0062 {};
0063
0064 }}}
0065
0066 #endif
0067 #endif