| /*============================================================================== |
| 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) |
| ==============================================================================*/ |
| namespace boost { namespace phoenix |
| { |
| namespace expression { template <typename Lhs, typename Rhs> struct mem_ptr : expr<proto::tag:: mem_ptr, Lhs, Rhs> {}; typedef proto::functional::make_expr<proto::tag:: mem_ptr> make_mem_ptr; } namespace rule { struct mem_ptr : expression:: mem_ptr<meta_grammar, meta_grammar> {}; } template <typename Dummy> struct meta_grammar::case_<proto::tag:: mem_ptr, Dummy> : enable_rule<rule:: mem_ptr, Dummy> {}; |
| template <typename Object, typename MemPtr> |
| inline |
| typename enable_if< |
| is_member_function_pointer<MemPtr> |
| , detail::mem_fun_ptr_gen<actor<Object>, MemPtr> const |
| >::type |
| operator->*(actor<Object> const& obj, MemPtr ptr) |
| { |
| return detail::mem_fun_ptr_gen<actor<Object>, MemPtr>(obj, ptr); |
| } |
| using proto::exprns_::operator->*; |
| namespace result_of |
| { |
| template < |
| typename Context |
| , typename A0 = void , typename A1 = void , typename A2 = void , typename A3 = void , typename A4 = void , typename A5 = void , typename A6 = void , typename A7 = void , typename A8 = void , typename A9 = void |
| , typename Dummy = void |
| > |
| struct mem_fun_ptr_eval; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1> |
| struct mem_fun_ptr_eval<Context, A0 , A1> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3 , typename A4> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; typedef typename evaluator::impl< A4 , Context , int >::result_type child4; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 , child4 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; typedef typename evaluator::impl< A4 , Context , int >::result_type child4; typedef typename evaluator::impl< A5 , Context , int >::result_type child5; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 , child4 , child5 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; typedef typename evaluator::impl< A4 , Context , int >::result_type child4; typedef typename evaluator::impl< A5 , Context , int >::result_type child5; typedef typename evaluator::impl< A6 , Context , int >::result_type child6; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 , child4 , child5 , child6 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; typedef typename evaluator::impl< A4 , Context , int >::result_type child4; typedef typename evaluator::impl< A5 , Context , int >::result_type child5; typedef typename evaluator::impl< A6 , Context , int >::result_type child6; typedef typename evaluator::impl< A7 , Context , int >::result_type child7; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 , child4 , child5 , child6 , child7 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; typedef typename evaluator::impl< A4 , Context , int >::result_type child4; typedef typename evaluator::impl< A5 , Context , int >::result_type child5; typedef typename evaluator::impl< A6 , Context , int >::result_type child6; typedef typename evaluator::impl< A7 , Context , int >::result_type child7; typedef typename evaluator::impl< A8 , Context , int >::result_type child8; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8 |
| ) |
| >::type |
| type; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| template <typename Context, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9> |
| struct mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9> |
| { |
| typedef typename evaluator::impl< A0 , Context , int >::result_type child0; typedef typename evaluator::impl< A1 , Context , int >::result_type child1; typedef typename evaluator::impl< A2 , Context , int >::result_type child2; typedef typename evaluator::impl< A3 , Context , int >::result_type child3; typedef typename evaluator::impl< A4 , Context , int >::result_type child4; typedef typename evaluator::impl< A5 , Context , int >::result_type child5; typedef typename evaluator::impl< A6 , Context , int >::result_type child6; typedef typename evaluator::impl< A7 , Context , int >::result_type child7; typedef typename evaluator::impl< A8 , Context , int >::result_type child8; typedef typename evaluator::impl< A9 , Context , int >::result_type child9; |
| typedef |
| typename boost::result_of< |
| child1( |
| child1 , child2 , child3 , child4 , child5 , child6 , child7 , child8 , child9 |
| ) |
| >::type |
| type; |
| }; |
| } |
| struct mem_fun_ptr_eval |
| { |
| template<typename Sig> |
| struct result; |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1, typename Context> |
| struct result<This(A0 , A1, Context)> |
| : result<This(A0 const& , A1 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1, typename Context> |
| struct result<This(A0 & , A1 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1> |
| {}; |
| template <typename A0 , typename A1, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2, typename Context> |
| struct result<This(A0 , A1 , A2, Context)> |
| : result<This(A0 const& , A1 const& , A2 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2, typename Context> |
| struct result<This(A0 & , A1 & , A2 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2> |
| {}; |
| template <typename A0 , typename A1 , typename A2, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3, typename Context> |
| struct result<This(A0 , A1 , A2 , A3, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename Context> |
| struct result<This(A0 , A1 , A2 , A3 , A4, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const& , A4 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 & , A4 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3 , typename A4, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) , boost::phoenix::eval(a4, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename Context> |
| struct result<This(A0 , A1 , A2 , A3 , A4 , A5, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 & , A4 & , A5 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) , boost::phoenix::eval(a4, ctx) , boost::phoenix::eval(a5, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename Context> |
| struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 & , A4 & , A5 & , A6 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) , boost::phoenix::eval(a4, ctx) , boost::phoenix::eval(a5, ctx) , boost::phoenix::eval(a6, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename Context> |
| struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 & , A4 & , A5 & , A6 & , A7 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) , boost::phoenix::eval(a4, ctx) , boost::phoenix::eval(a5, ctx) , boost::phoenix::eval(a6, ctx) , boost::phoenix::eval(a7, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename Context> |
| struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 & , A4 & , A5 & , A6 & , A7 & , A8 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) , boost::phoenix::eval(a4, ctx) , boost::phoenix::eval(a5, ctx) , boost::phoenix::eval(a6, ctx) , boost::phoenix::eval(a7, ctx) , boost::phoenix::eval(a8, ctx) |
| ); |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9, typename Context> |
| struct result<This(A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9, Context)> |
| : result<This(A0 const& , A1 const& , A2 const& , A3 const& , A4 const& , A5 const& , A6 const& , A7 const& , A8 const& , A9 const&, Context)> |
| {}; |
| template <typename This, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9, typename Context> |
| struct result<This(A0 & , A1 & , A2 & , A3 & , A4 & , A5 & , A6 & , A7 & , A8 & , A9 &, Context)> |
| : result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9> |
| {}; |
| template <typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9, typename Context> |
| typename result_of::mem_fun_ptr_eval<Context, A0 , A1 , A2 , A3 , A4 , A5 , A6 , A7 , A8 , A9>::type |
| operator()( |
| A0 const& a0 , A1 const& a1 , A2 const& a2 , A3 const& a3 , A4 const& a4 , A5 const& a5 , A6 const& a6 , A7 const& a7 , A8 const& a8 , A9 const& a9 |
| , Context & ctx |
| ) const |
| { |
| return |
| ( |
| get_pointer(boost::phoenix::eval(a0, ctx)) |
| ->*boost::phoenix::eval(a1, ctx) |
| )( |
| boost::phoenix::eval(a2, ctx) , boost::phoenix::eval(a3, ctx) , boost::phoenix::eval(a4, ctx) , boost::phoenix::eval(a5, ctx) , boost::phoenix::eval(a6, ctx) , boost::phoenix::eval(a7, ctx) , boost::phoenix::eval(a8, ctx) , boost::phoenix::eval(a9, ctx) |
| ); |
| } |
| |
| }; |
| template <typename Dummy> |
| struct default_actions::when<rule::mem_fun_ptr, Dummy> |
| : call<mem_fun_ptr_eval> |
| {}; |
| }} |