10 #define RPC_MEMBER_FUNCTOR(z,n,IS_CONST) \
11 template<typename R, typename C, typename P BOOST_PP_ENUM_TRAILING_PARAMS( n, typename A)> \
12 static std::function<fc::future<R>( BOOST_PP_ENUM_PARAMS(n,A) ) > \
13 functor( P p, R (C::*mem_func)(BOOST_PP_ENUM_PARAMS(n,A)) IS_CONST, fc::thread* c = 0) { \
14 return [=](BOOST_PP_ENUM_BINARY_PARAMS(n,A,a))->fc::future<R>{ \
15 return c->async( [=](){ return (p->*mem_func)(BOOST_PP_ENUM_PARAMS(n,a)); } ); }; \
19 #undef RPC_MEMBER_FUNCTOR
23 template<
typename R,
typename C,
typename P,
typename... Args>
24 static std::function<fc::future<R>(Args...)> functor(
P&&
p,
R (C::*mem_func)(Args...), fc::thread* c ) {
25 return [=](Args... args)->fc::future<R>{ c->async( [=]()->
R {
return p->*mem_func( fc::forward<Args>(args)... ); } ) };
27 template<
typename R,
typename C,
typename P,
typename... Args>
28 static std::function<fc::future<R>(Args...)> functor(
P&&
p,
R (C::*mem_func)(Args...)const, fc::thread* c ){
29 return [=](Args... args)->fc::future<R>{ c->async( [=]()->
R {
return p->*mem_func( fc::forward<Args>(args)... ); } ) };