• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef BOOST_METAPARSE_V1_CPP98_IMPL_AT_C_HPP
2 #define BOOST_METAPARSE_V1_CPP98_IMPL_AT_C_HPP
3 
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)
8 
9 #include <boost/metaparse/config.hpp>
10 #include <boost/metaparse/v1/cpp98/fwd/string.hpp>
11 
12 #include <boost/mpl/char.hpp>
13 
14 #include <boost/preprocessor/repetition/enum_params.hpp>
15 #include <boost/preprocessor/repetition/repeat.hpp>
16 
17 namespace boost
18 {
19   namespace metaparse
20   {
21     namespace v1
22     {
23       namespace impl
24       {
25         template <class S, int N>
26         struct at_c;
27 
28         #ifdef BOOST_METAPARSE_STRING_CASE
29         #  error BOOST_METAPARSE_STRING_CASE is already defined
30         #endif
31         #define BOOST_METAPARSE_STRING_CASE(z, n, unused) \
32           template < \
33             BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
34           > \
35           struct \
36             at_c< \
37               string< \
38                 BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C) \
39               >, \
40               n \
41             > : \
42             boost::mpl::char_<BOOST_PP_CAT(C, n)> \
43           {};
44 
45         BOOST_PP_REPEAT(
46           BOOST_METAPARSE_LIMIT_STRING_SIZE,
47           BOOST_METAPARSE_STRING_CASE,
48           ~
49         )
50 
51         #undef BOOST_METAPARSE_STRING_CASE
52       }
53     }
54   }
55 }
56 
57 #endif
58 
59