File indexing completed on 2025-01-18 09:40:48
0001 #ifndef BOOST_METAPARSE_V1_CPP98_SEQUENCE_HPP
0002 #define BOOST_METAPARSE_V1_CPP98_SEQUENCE_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/metaparse/v1/cpp98/impl/sequence.hpp>
0010
0011 #include <boost/preprocessor/comma_if.hpp>
0012 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0013 #include <boost/preprocessor/repetition/enum.hpp>
0014 #include <boost/preprocessor/repetition/enum_params.hpp>
0015 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
0016 #include <boost/preprocessor/arithmetic/sub.hpp>
0017 #include <boost/preprocessor/cat.hpp>
0018 #include <boost/preprocessor/tuple/eat.hpp>
0019
0020 namespace boost
0021 {
0022 namespace metaparse
0023 {
0024 namespace v1
0025 {
0026 template <
0027 BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
0028 BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
0029 class P,
0030 boost::mpl::na
0031 )
0032 >
0033 struct sequence;
0034
0035 #ifdef BOOST_METAPARSE_SEQUENCE_N
0036 # error BOOST_METAPARSE_SEQUENCE_N already defined
0037 #endif
0038 #define BOOST_METAPARSE_SEQUENCE_N(z, n, unused) \
0039 template <BOOST_PP_ENUM_PARAMS(n, class P)> \
0040 struct sequence< \
0041 BOOST_PP_ENUM_PARAMS(n, P) \
0042 BOOST_PP_COMMA_IF(n) \
0043 BOOST_PP_ENUM( \
0044 BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \
0045 boost::mpl::na BOOST_PP_TUPLE_EAT(3), \
0046 ~ \
0047 ) \
0048 > : impl::BOOST_PP_CAT(sequence, n)<BOOST_PP_ENUM_PARAMS(n, P)> \
0049 {};
0050
0051 BOOST_PP_REPEAT_FROM_TO(
0052 1,
0053 BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
0054 BOOST_METAPARSE_SEQUENCE_N,
0055 ~
0056 )
0057
0058 #undef BOOST_METAPARSE_SEQUENCE_N
0059 }
0060 }
0061 }
0062
0063 #endif
0064