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_SIZE_HPP
0002 #define BOOST_METAPARSE_V1_CPP98_IMPL_SIZE_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/mpl/int.hpp>
0012 
0013 #include <boost/preprocessor/arithmetic/sub.hpp>
0014 #include <boost/preprocessor/punctuation/comma_if.hpp>
0015 #include <boost/preprocessor/repetition/enum.hpp>
0016 #include <boost/preprocessor/repetition/enum_params.hpp>
0017 #include <boost/preprocessor/repetition/repeat.hpp>
0018 #include <boost/preprocessor/tuple/eat.hpp>
0019 
0020 namespace boost
0021 {
0022   namespace metaparse
0023   {
0024     namespace v1
0025     {
0026       namespace impl
0027       {
0028         template <class S>
0029         struct size;
0030 
0031         #ifdef BOOST_METAPARSE_STRING_CASE
0032         #  error BOOST_METAPARSE_STRING_CASE
0033         #endif
0034         #define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
0035           template <BOOST_PP_ENUM_PARAMS(n, int C)> \
0036           struct \
0037             size< \
0038               string< \
0039                 BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
0040                 BOOST_PP_ENUM( \
0041                   BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
0042                   BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
0043                   ~ \
0044                 ) \
0045               > \
0046             > : \
0047             boost::mpl::int_<n> \
0048           {};
0049   
0050         BOOST_PP_REPEAT(
0051           BOOST_METAPARSE_LIMIT_STRING_SIZE,
0052           BOOST_METAPARSE_STRING_CASE,
0053           ~
0054         )
0055   
0056         #undef BOOST_METAPARSE_STRING_CASE
0057       }
0058     }
0059   }
0060 }
0061 
0062 #endif
0063