]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/metaparse/v1/look_ahead.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / metaparse / v1 / look_ahead.hpp
1 #ifndef BOOST_METAPARSE_V1_LOOK_AHEAD_HPP
2 #define BOOST_METAPARSE_V1_LOOK_AHEAD_HPP
3
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
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/is_error.hpp>
10 #include <boost/metaparse/v1/accept.hpp>
11 #include <boost/metaparse/v1/get_result.hpp>
12
13 #include <boost/mpl/eval_if.hpp>
14
15 namespace boost
16 {
17 namespace metaparse
18 {
19 namespace v1
20 {
21 template <class P>
22 struct look_ahead
23 {
24 private:
25 template <class S, class Pos>
26 struct no_error :
27 accept<
28 typename get_result<typename P::template apply<S, Pos> >::type,
29 S,
30 Pos
31 >
32 {};
33 public:
34 typedef look_ahead type;
35
36 template <class S, class Pos>
37 struct apply :
38 boost::mpl::eval_if<
39 typename is_error<typename P::template apply<S, Pos> >::type,
40 typename P::template apply<S, Pos>,
41 no_error<S, Pos>
42 >
43 {};
44 };
45 }
46 }
47 }
48
49 #endif
50