Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:48

0001 #ifndef BOOST_METAPARSE_V1_CPP98_NTH_OF_C_HPP
0002 #define BOOST_METAPARSE_V1_CPP98_NTH_OF_C_HPP
0003 
0004 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2013.
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/metaparse/v1/cpp98/impl/nth_of_c.hpp>
0010 #include <boost/metaparse/limit_sequence_size.hpp>
0011 
0012 #include <boost/preprocessor/repetition/repeat.hpp>
0013 #include <boost/preprocessor/repetition/enum.hpp>
0014 #include <boost/preprocessor/punctuation/comma_if.hpp>
0015 #include <boost/preprocessor/repetition/enum_params.hpp>
0016 #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
0017 #include <boost/preprocessor/arithmetic/sub.hpp>
0018 #include <boost/preprocessor/cat.hpp>
0019 #include <boost/preprocessor/tuple/eat.hpp>
0020 
0021 namespace boost
0022 {
0023   namespace metaparse
0024   {
0025     namespace v1
0026     {
0027       template <
0028         int N,
0029         BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
0030           BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
0031           class P,
0032           boost::mpl::na
0033         )
0034       >
0035       struct nth_of_c;
0036 
0037       #ifdef BOOST_METAPARSE_NTH_OF_N
0038       #  error BOOST_METAPARSE_NTH_OF_N already defined
0039       #endif
0040       #define BOOST_METAPARSE_NTH_OF_N(z, n, unused) \
0041         template <int K BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class P)> \
0042         struct nth_of_c< \
0043           K, \
0044           BOOST_PP_ENUM_PARAMS(n, P) \
0045           BOOST_PP_COMMA_IF(n) \
0046           BOOST_PP_ENUM( \
0047             BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE, n), \
0048             boost::mpl::na BOOST_PP_TUPLE_EAT(3), \
0049             ~ \
0050           ) \
0051         > : \
0052           impl::BOOST_PP_CAT(nth_of_c, n)< \
0053             K BOOST_PP_COMMA_IF(n) \
0054             BOOST_PP_ENUM_PARAMS(n, P) \
0055           > \
0056         {};
0057       
0058       BOOST_PP_REPEAT(
0059         BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE,
0060         BOOST_METAPARSE_NTH_OF_N,
0061         ~
0062       )
0063       
0064       #undef BOOST_METAPARSE_NTH_OF_N
0065     }
0066   }
0067 }
0068 
0069 #endif
0070