Chris@16: Chris@16: #if !BOOST_PHOENIX_IS_ITERATING Chris@16: Chris@16: #ifndef BOOST_PHOENIX_STATEMENT_DETAIL_CATCH_PUSH_BACK_HPP Chris@16: #define BOOST_PHOENIX_STATEMENT_DETAIL_CATCH_PUSH_BACK_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) Chris@16: Chris@16: #include Chris@16: Chris@16: #else Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 2, line: 0, output: "preprocessed/catch_push_back_" BOOST_PHOENIX_LIMIT_STR ".hpp") Chris@16: #endif Chris@16: Chris@16: /*============================================================================== Chris@16: Copyright (c) 2005-2010 Joel de Guzman Chris@16: Copyright (c) 2010 Thomas Heller Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: ==============================================================================*/ Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 1) Chris@16: #endif Chris@16: Chris@16: #define BOOST_PHOENIX_CATCH_PUSH_BACK_R0(Z, N, DATA) \ Chris@16: BOOST_PP_COMMA_IF(N) \ Chris@16: typename proto::result_of::child_c::type \ Chris@16: /**/ Chris@16: Chris@16: #define BOOST_PHOENIX_CATCH_PUSH_BACK_R1(Z, N, DATA) \ Chris@16: BOOST_PP_COMMA_IF(N) proto::child_c(try_catch) \ Chris@16: /**/ Chris@16: Chris@16: #define BOOST_PHOENIX_ITERATION_PARAMS \ Chris@16: (3, (2, BOOST_PHOENIX_CATCH_LIMIT, \ Chris@16: )) Chris@16: #include BOOST_PHOENIX_ITERATE() Chris@16: Chris@16: #undef BOOST_PHOENIX_CATCH_PUSH_BACK_R0 Chris@16: #undef BOOST_PHOENIX_CATCH_PUSH_BACK_R1 Chris@16: Chris@16: #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(output: null) Chris@16: #endif Chris@16: Chris@16: #endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES Chris@16: Chris@16: #endif Chris@16: Chris@16: #else Chris@16: template Chris@16: struct catch_push_back Chris@16: { Chris@16: typedef Chris@16: typename proto::result_of::make_expr< Chris@16: phoenix::tag::catch_ Chris@16: , proto::basic_default_domain Chris@16: , catch_exception Chris@16: , Expr Chris@16: >::type Chris@16: catch_expr; Chris@16: Chris@16: typedef phoenix::expression::try_catch< Chris@16: BOOST_PP_REPEAT(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_CATCH_PUSH_BACK_R0, _) Chris@16: , catch_expr> gen_type; Chris@16: typedef typename gen_type::type type; Chris@16: Chris@16: static type Chris@16: make( Chris@16: TryCatch const& try_catch Chris@16: , Expr const& catch_ Chris@16: ) Chris@16: { Chris@16: return Chris@16: gen_type::make( Chris@16: BOOST_PP_REPEAT( Chris@16: BOOST_PHOENIX_ITERATION Chris@16: , BOOST_PHOENIX_CATCH_PUSH_BACK_R1 Chris@16: , _ Chris@16: ) Chris@16: , proto::make_expr< Chris@16: phoenix::tag::catch_ Chris@16: , proto::basic_default_domain Chris@16: >(catch_exception(), catch_) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct catch_all_push_back Chris@16: { Chris@16: typedef Chris@16: typename proto::result_of::make_expr< Chris@16: phoenix::tag::catch_all Chris@16: , proto::basic_default_domain Chris@16: , Expr Chris@16: >::type Chris@16: catch_expr; Chris@16: Chris@16: typedef phoenix::expression::try_catch< Chris@16: BOOST_PP_REPEAT(BOOST_PHOENIX_ITERATION, BOOST_PHOENIX_CATCH_PUSH_BACK_R0, _) Chris@16: , catch_expr> gen_type; Chris@16: typedef typename gen_type::type type; Chris@16: Chris@16: static type Chris@16: make( Chris@16: TryCatch const& try_catch Chris@16: , Expr const& catch_ Chris@16: ) Chris@16: { Chris@16: return Chris@16: gen_type::make( Chris@16: BOOST_PP_REPEAT( Chris@16: BOOST_PHOENIX_ITERATION Chris@16: , BOOST_PHOENIX_CATCH_PUSH_BACK_R1 Chris@16: , _ Chris@16: ) Chris@16: , proto::make_expr< Chris@16: phoenix::tag::catch_all Chris@16: , proto::basic_default_domain Chris@16: >(catch_) Chris@16: ); Chris@16: } Chris@16: }; Chris@16: Chris@16: #endif