1 #ifndef BOOST_METAPARSE_V1_CPP98_IMPL_UPDATE_C_HPP
2 #define BOOST_METAPARSE_V1_CPP98_IMPL_UPDATE_C_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/metaparse/v1/cpp98/fwd/string.hpp>
11 #include <boost/preprocessor/arithmetic/dec.hpp>
12 #include <boost/preprocessor/arithmetic/inc.hpp>
13 #include <boost/preprocessor/cat.hpp>
14 #include <boost/preprocessor/punctuation/comma_if.hpp>
15 #include <boost/preprocessor/repetition/enum_params.hpp>
16 #include <boost/preprocessor/repetition/repeat.hpp>
17 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
27 template <class S, int N, int C>
30 #ifdef BOOST_METAPARSE_ARGN
31 # error BOOST_METAPARSE_ARGN already defined
33 #define BOOST_METAPARSE_ARGN(z, n, unused) , BOOST_PP_CAT(C, n)
35 #ifdef BOOST_METAPARSE_UPDATE
36 # error BOOST_METAPARSE_UPDATE already defined
38 #define BOOST_METAPARSE_UPDATE(z, n, unused) \
40 BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C), \
44 string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>,\
49 BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
51 BOOST_PP_REPEAT_FROM_TO( \
53 BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE), \
54 BOOST_METAPARSE_ARGN, \
61 BOOST_METAPARSE_LIMIT_STRING_SIZE,
62 BOOST_METAPARSE_UPDATE,
66 #undef BOOST_METAPARSE_UPDATE
67 #undef BOOST_METAPARSE_ARGN