]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #ifndef BOOST_METAPARSE_V1_FOLDL_START_WITH_PARSER_HPP |
2 | #define BOOST_METAPARSE_V1_FOLDL_START_WITH_PARSER_HPP | |
3 | ||
4 | // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012. | |
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/v1/foldl.hpp> | |
10 | ||
11 | namespace boost | |
12 | { | |
13 | namespace metaparse | |
14 | { | |
15 | namespace v1 | |
16 | { | |
17 | template <class P, class StateP, class ForwardOp> | |
18 | class foldl_start_with_parser | |
19 | { | |
20 | private: | |
21 | template <class Res> | |
22 | struct apply_unchecked : | |
23 | foldl<P, typename get_result<Res>::type, ForwardOp>::template apply< | |
24 | typename get_remaining<Res>::type, | |
25 | typename get_position<Res>::type | |
26 | > | |
27 | {}; | |
28 | public: | |
29 | typedef foldl_start_with_parser type; | |
30 | ||
31 | template <class S, class Pos> | |
32 | struct apply : | |
33 | boost::mpl::eval_if< | |
34 | typename is_error<typename StateP::template apply<S, Pos> >::type, | |
35 | typename StateP::template apply<S, Pos>, | |
36 | apply_unchecked<typename StateP::template apply<S, Pos> > | |
37 | > | |
38 | {}; | |
39 | }; | |
40 | } | |
41 | } | |
42 | } | |
43 | ||
44 | #endif | |
45 |