]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #ifndef BOOST_METAPARSE_V1_IMPL_POP_FRONT_HPP |
2 | #define BOOST_METAPARSE_V1_IMPL_POP_FRONT_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/fwd/string.hpp> | |
11 | ||
12 | #include <boost/preprocessor/repetition/enum_params.hpp> | |
13 | #include <boost/preprocessor/repetition/repeat_from_to.hpp> | |
14 | ||
15 | namespace boost | |
16 | { | |
17 | namespace metaparse | |
18 | { | |
19 | namespace v1 | |
20 | { | |
21 | namespace impl | |
22 | { | |
23 | template <class S> | |
24 | struct pop_front; | |
25 | ||
26 | #ifdef BOOST_METAPARSE_VARIADIC_STRING | |
27 | template <char C, char... Cs> | |
28 | struct pop_front<string<C, Cs...>> : string<Cs...> {}; | |
29 | #else | |
30 | #ifdef BOOST_METAPARSE_POP_FRONT | |
31 | # error BOOST_METAPARSE_POP_FRONT already defined | |
32 | #endif | |
33 | #define BOOST_METAPARSE_POP_FRONT(z, n, unused) \ | |
34 | BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) BOOST_PP_CAT(C, n) | |
35 | ||
36 | template < \ | |
37 | BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \ | |
38 | > | |
39 | struct | |
40 | pop_front< | |
41 | string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)> | |
42 | > : | |
43 | string< | |
44 | BOOST_PP_REPEAT_FROM_TO( | |
45 | 1, | |
46 | BOOST_METAPARSE_LIMIT_STRING_SIZE, | |
47 | BOOST_METAPARSE_POP_FRONT, | |
48 | ~ | |
49 | ), | |
50 | BOOST_NO_CHAR | |
51 | > | |
52 | {}; | |
53 | ||
54 | #undef BOOST_METAPARSE_POP_FRONT | |
55 | #endif | |
56 | } | |
57 | } | |
58 | } | |
59 | } | |
60 | ||
61 | #endif | |
62 |