1 #ifndef BOOST_METAPARSE_V1_FOLDR1_HPP 2 #define BOOST_METAPARSE_V1_FOLDR1_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/foldr.hpp> 10 11 #include <boost/mpl/if.hpp> 12 13 namespace boost 14 { 15 namespace metaparse 16 { 17 namespace v1 18 { 19 template <class P, class State, class BackwardOp> 20 struct foldr1 21 { 22 typedef foldr1 type; 23 24 template <class S, class Pos> 25 struct apply : 26 boost::mpl::if_< 27 is_error<typename P::template apply<S, Pos> >, 28 P, 29 foldr<P, State, BackwardOp> 30 >::type::template apply<S, Pos> 31 {}; 32 }; 33 } 34 } 35 } 36 37 #endif 38 39