Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:50

0001 #ifndef BOOST_METAPARSE_V1_TRANSFORM_ERROR_MESSAGE_HPP
0002 #define BOOST_METAPARSE_V1_TRANSFORM_ERROR_MESSAGE_HPP
0003 
0004 //    Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/metaparse/v1/is_error.hpp>
0010 #include <boost/metaparse/v1/reject.hpp>
0011 #include <boost/metaparse/v1/get_position.hpp>
0012 #include <boost/metaparse/v1/get_message.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 F>
0023       struct transform_error_message
0024       {
0025         template <class R>
0026         struct rejection :
0027           reject<
0028             typename F::template apply<typename get_message<R>::type>::type,
0029             get_position<R>
0030           >
0031         {};
0032 
0033         template <class S, class Pos>
0034         struct apply :
0035           boost::mpl::eval_if<
0036             typename is_error<typename P::template apply<S, Pos> >::type,
0037             rejection<typename P::template apply<S, Pos> >,
0038             typename P::template apply<S, Pos>
0039           >
0040         {};
0041         
0042         typedef transform_error_message type;
0043       };
0044     }
0045   }
0046 }
0047 
0048 #endif
0049