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