Home | Libraries | People | FAQ | More |
template <class E> struct get_message;
This is a lazy template metafunction.
Returns the error message of a parsing failure.
#include <boost/metaparse/get_message.hpp>
#include <boost/metaparse/get_message.hpp> #include <boost/metaparse/start.hpp> #include <boost/metaparse/reject.hpp> #include <boost/metaparse/define_error.hpp> #include <type_traits> using namespace boost::metaparse; BOOST_METAPARSE_DEFINE_ERROR(sample_error, "Sample error message"); struct returns_reject { using type = reject<sample_error, start>; }; static_assert( std::is_same< sample_error, get_message<reject<sample_error, start>>::type >::type::value, "It should return the message" ); static_assert( std::is_same<sample_error, get_message<returns_reject>::type>::type::value, "It should support lazy evaluation" );