/*============================================================================== Copyright (c) 2005-2007 Dan Marsden Copyright (c) 2005-2010 Joel de Guzman Copyright (c) 2010 Thomas Heller Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef BOOST_PHOENIX_STATEMENT_THROW_HPP #define BOOST_PHOENIX_STATEMENT_THROW_HPP #include #include #include #include #include #include #include namespace boost { namespace phoenix { namespace tag { struct throw_ {}; } namespace expression { template struct throw_ : expr {}; } namespace rule { struct throw_ : expression::throw_ {}; } template struct meta_grammar::case_ : enable_rule {}; struct throw_eval { typedef void result_type; template result_type operator()(ThrowExpr const& throw_expr, Context const & ctx) const { throw boost::phoenix::eval(throw_expr, ctx); } }; template struct default_actions::when : call {}; template inline typename expression::throw_::type const throw_(ThrowExpr const& throw_expr) { return expression::throw_::make(throw_expr); } namespace detail { struct rethrow {}; } namespace expression { struct rethrow : expression::value {}; } template struct is_custom_terminal : mpl::true_ {}; template struct custom_terminal { typedef void result_type; //#ifndef BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL typedef void _is_throw_custom_terminal; // fix for #7730 //#endif template void operator()(detail::rethrow, Context &) const { throw; } }; inline expression::rethrow::type const throw_() { return expression::rethrow::make(detail::rethrow()); } }} #endif