File indexing completed on 2025-01-18 09:40:49
0001 #ifndef BOOST_METAPARSE_V1_LOOK_AHEAD_HPP
0002 #define BOOST_METAPARSE_V1_LOOK_AHEAD_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/metaparse/v1/is_error.hpp>
0010 #include <boost/metaparse/v1/accept.hpp>
0011 #include <boost/metaparse/v1/get_result.hpp>
0012
0013 #include <boost/mpl/eval_if.hpp>
0014
0015 namespace boost
0016 {
0017 namespace metaparse
0018 {
0019 namespace v1
0020 {
0021 template <class P>
0022 struct look_ahead
0023 {
0024 private:
0025 template <class S, class Pos>
0026 struct no_error :
0027 accept<
0028 typename get_result<typename P::template apply<S, Pos> >::type,
0029 S,
0030 Pos
0031 >
0032 {};
0033 public:
0034 typedef look_ahead type;
0035
0036 template <class S, class Pos>
0037 struct apply :
0038 boost::mpl::eval_if<
0039 typename is_error<typename P::template apply<S, Pos> >::type,
0040 typename P::template apply<S, Pos>,
0041 no_error<S, Pos>
0042 >
0043 {};
0044 };
0045 }
0046 }
0047 }
0048
0049 #endif
0050