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_IMPL_UPDATE_C_HPP
0002 #define BOOST_METAPARSE_V1_CPP98_IMPL_UPDATE_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/fwd/string.hpp>
0010 
0011 #include <boost/preprocessor/arithmetic/dec.hpp>
0012 #include <boost/preprocessor/arithmetic/inc.hpp>
0013 #include <boost/preprocessor/cat.hpp>
0014 #include <boost/preprocessor/punctuation/comma_if.hpp>
0015 #include <boost/preprocessor/repetition/enum_params.hpp>
0016 #include <boost/preprocessor/repetition/repeat.hpp>
0017 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0018 
0019 namespace boost
0020 {
0021   namespace metaparse
0022   {
0023     namespace v1
0024     {
0025       namespace impl
0026       {
0027         template <class S, int N, int C>
0028         struct update_c;
0029 
0030         #ifdef BOOST_METAPARSE_ARGN
0031         #  error BOOST_METAPARSE_ARGN already defined
0032         #endif
0033         #define BOOST_METAPARSE_ARGN(z, n, unused) , BOOST_PP_CAT(C, n)
0034 
0035         #ifdef BOOST_METAPARSE_UPDATE
0036         #  error BOOST_METAPARSE_UPDATE already defined
0037         #endif
0038         #define BOOST_METAPARSE_UPDATE(z, n, unused) \
0039           template < \
0040             BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C), \
0041             int Ch \
0042           > \
0043           struct update_c< \
0044             string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>,\
0045             n, \
0046             Ch \
0047           > : \
0048             string< \
0049               BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
0050               Ch \
0051               BOOST_PP_REPEAT_FROM_TO( \
0052                 BOOST_PP_INC(n), \
0053                 BOOST_PP_DEC(BOOST_METAPARSE_LIMIT_STRING_SIZE), \
0054                 BOOST_METAPARSE_ARGN, \
0055                 ~ \
0056               ) \
0057             > \
0058           {};
0059 
0060         BOOST_PP_REPEAT(
0061           BOOST_METAPARSE_LIMIT_STRING_SIZE,
0062           BOOST_METAPARSE_UPDATE,
0063           ~
0064         )
0065 
0066         #undef BOOST_METAPARSE_UPDATE
0067         #undef BOOST_METAPARSE_ARGN
0068       }
0069     }
0070   }
0071 }
0072 
0073 #endif
0074