X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/eb3d5c6416c0f0d1cad35e52af3231de7866fea8..26ade07ab0e62b98b452fbbd18edba0450035e35:/rpc/marshall_wrap.h diff --git a/rpc/marshall_wrap.h b/rpc/marshall_wrap.h index 4ba7a20..b895696 100644 --- a/rpc/marshall_wrap.h +++ b/rpc/marshall_wrap.h @@ -3,7 +3,7 @@ #include "marshall.h" -typedef function handler; +typedef std::function handler; // // Automatic marshalling wrappers for RPC handlers @@ -45,7 +45,7 @@ struct VerifyOnFailure { template typename enable_if::value, RV>::type inline invoke(RV, F f, void *, R & r, args_type & t, tuple_indices) { - return f(r, move(get(t))...); + return f(r, get(t)...); } // And one for pointers to member functions... @@ -53,7 +53,7 @@ invoke(RV, F f, void *, R & r, args_type & t, tuple_indices) { template typename enable_if::value, RV>::type inline invoke(RV, F f, C *c, R & r, args_type & t, tuple_indices) { - return (c->*f)(r, move(get(t))...); + return (c->*f)(r, get(t)...); } // The class marshalled_func_imp uses partial template specialization to @@ -73,9 +73,6 @@ template struct marshalled_func_imp { static inline handler *wrap(F f, C *c=nullptr) { - // This type definition corresponds to an empty struct with - // template parameters running from 0 up to (# args) - 1. - using Indices = typename make_tuple_indices::type; // This type definition represents storage for f's unmarshalled // arguments. decay is (most notably) stripping off const // qualifiers. @@ -92,10 +89,10 @@ struct marshalled_func_imp { // Allocate space for the RPC response -- will be passed into the // function as an lvalue reference. R r; - // Perform the invocation. Note that Indices() calls the default - // constructor of the empty struct with the special template - // parameters. - RV b = invoke(RV(), f, c, r, t, Indices()); + // Perform the invocation. Note that TUPLE_INDICES calls the + // default constructor of an empty struct with template parameters + // running from 0 up to (# args) - 1. + RV b = invoke(RV(), f, c, r, t, TUPLE_INDICES(Args)); // Marshall the response. m << r; // Make like a tree. @@ -121,7 +118,7 @@ struct marshalled_func : public marshalled_func_imp {}; template -struct marshalled_func> : +struct marshalled_func> : public marshalled_func_imp {}; #endif