1 #ifndef BOOST_METAPARSE_V1_TRANSFORM_ERROR_HPP 2 #define BOOST_METAPARSE_V1_TRANSFORM_ERROR_HPP 3 4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2015. 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 11 #include <boost/mpl/eval_if.hpp> 12 13 namespace boost 14 { 15 namespace metaparse 16 { 17 namespace v1 18 { 19 template <class P, class F> 20 struct transform_error 21 { 22 template <class S, class Pos> 23 struct apply : 24 boost::mpl::eval_if< 25 typename is_error<typename P::template apply<S, Pos> >::type, 26 typename F::template apply< 27 typename P::template apply<S, Pos>::type 28 >, 29 typename P::template apply<S, Pos> 30 > 31 {}; 32 33 typedef transform_error type; 34 }; 35 } 36 } 37 } 38 39 #endif 40 41