1 /*==============================================================================
2 Copyright (c) 2005-2007 Dan Marsden
3 Copyright (c) 2005-2010 Joel de Guzman
4 Copyright (c) 2010 Thomas Heller
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9 #ifndef BOOST_PHOENIX_STATEMENT_THROW_HPP
10 #define BOOST_PHOENIX_STATEMENT_THROW_HPP
12 #include <boost/phoenix/core/limits.hpp>
13 #include <boost/phoenix/core/actor.hpp>
14 #include <boost/phoenix/core/call.hpp>
15 #include <boost/phoenix/core/meta_grammar.hpp>
16 #include <boost/phoenix/core/expression.hpp>
17 #include <boost/phoenix/core/terminal.hpp>
18 #include <boost/phoenix/core/value.hpp>
20 namespace boost { namespace phoenix
31 : expr<tag::throw_, A>
38 : expression::throw_<meta_grammar>
42 template <typename Dummy>
43 struct meta_grammar::case_<tag::throw_, Dummy>
44 : enable_rule<rule::throw_, Dummy>
49 typedef void result_type;
51 template <typename ThrowExpr, typename Context>
53 operator()(ThrowExpr const& throw_expr, Context const & ctx) const
55 throw boost::phoenix::eval(throw_expr, ctx);
59 template <typename Dummy>
60 struct default_actions::when<rule::throw_, Dummy>
64 template <typename ThrowExpr>
66 typename expression::throw_<ThrowExpr>::type const
67 throw_(ThrowExpr const& throw_expr)
69 return expression::throw_<ThrowExpr>::make(throw_expr);
80 : expression::value<detail::rethrow>
84 template<typename Dummy>
85 struct is_custom_terminal<detail::rethrow, Dummy>
89 template<typename Dummy>
90 struct custom_terminal<detail::rethrow, Dummy>
92 typedef void result_type;
93 //#ifndef BOOST_PHOENIX_NO_SPECIALIZE_CUSTOM_TERMINAL
94 typedef void _is_throw_custom_terminal; // fix for #7730
97 template <typename Context>
98 void operator()(detail::rethrow, Context &) const
105 expression::rethrow::type const
108 return expression::rethrow::make(detail::rethrow());