1 #ifndef BOOST_METAPARSE_V1_IMPL_SIZE_HPP
2 #define BOOST_METAPARSE_V1_IMPL_SIZE_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/config.hpp>
10 #include <boost/metaparse/v1/fwd/string.hpp>
12 #include <boost/mpl/int.hpp>
14 #include <boost/preprocessor/arithmetic/sub.hpp>
15 #include <boost/preprocessor/punctuation/comma_if.hpp>
16 #include <boost/preprocessor/repetition/enum.hpp>
17 #include <boost/preprocessor/repetition/enum_params.hpp>
18 #include <boost/preprocessor/repetition/repeat.hpp>
19 #include <boost/preprocessor/tuple/eat.hpp>
32 #ifdef BOOST_METAPARSE_VARIADIC_STRING
34 struct size<string<Cs...>> : boost::mpl::int_<sizeof...(Cs)> {};
36 #ifdef BOOST_METAPARSE_STRING_CASE
37 # error BOOST_METAPARSE_STRING_CASE
39 #define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
40 template <BOOST_PP_ENUM_PARAMS(n, int C)> \
44 BOOST_PP_ENUM_PARAMS(n, C) BOOST_PP_COMMA_IF(n) \
46 BOOST_PP_SUB(BOOST_METAPARSE_LIMIT_STRING_SIZE, n), \
47 BOOST_NO_CHAR BOOST_PP_TUPLE_EAT(3), \
56 BOOST_METAPARSE_LIMIT_STRING_SIZE,
57 BOOST_METAPARSE_STRING_CASE,
61 #undef BOOST_METAPARSE_STRING_CASE