1 /*=============================================================================
2 Copyright (c) 2005-2007 Dan Marsden
3 Copyright (c) 2005-2007 Joel de Guzman
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
9 #ifndef PHOENIX_STATEMENT_THROW_HPP
10 #define PHOENIX_STATEMENT_THROW_HPP
12 #include <boost/spirit/home/phoenix/core/actor.hpp>
13 #include <boost/spirit/home/phoenix/core/composite.hpp>
14 #include <boost/spirit/home/phoenix/core/compose.hpp>
16 #include <boost/mpl/bool.hpp>
18 namespace boost { namespace phoenix {
22 template<typename Env, typename ThrowExpr>
28 template<typename Rt, typename Env, typename ThrowExpr>
30 eval(const Env& env, ThrowExpr& throwExpr)
32 throw throwExpr.eval(env);
36 struct throw_again_eval
38 typedef mpl::false_ no_nullary;
40 template<typename Env>
46 template<typename Env>
47 void eval(const Env&) const
53 inline actor<throw_again_eval> throw_()
55 return throw_again_eval();
58 template<typename Actor>
59 actor<typename as_composite<throw_new_eval, Actor>::type>
60 throw_(const Actor& a)
62 return compose<throw_new_eval>(a);