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