@@ -94,11 +94,7 @@ class RpcFunctionWrapper<R(Args...)>: public IFunctionWrapper {
9494 return false ;
9595 }
9696
97- // unpacker not ready if deserialization fails at this point
98- std::tuple<Args...> args;
99- if (!deserialize_all<Args...>(unpacker, args)) return false ;
100-
101- return handle_call (args, packer);
97+ return handle_call (unpacker, packer);
10298
10399#ifdef HANDLE_RPC_ERRORS
104100 } catch (const std::exception& e) {
@@ -116,7 +112,10 @@ class RpcFunctionWrapper<R(Args...)>: public IFunctionWrapper {
116112
117113 template <typename Dummy = R>
118114 typename std::enable_if<std::is_void<Dummy>::value, bool >::type
119- handle_call (auto && args, auto && packer) {
115+ handle_call (MsgPack::Unpacker& unpacker, MsgPack::Packer& packer) {
116+ // unpacker not ready if deserialization fails at this point
117+ std::tuple<Args...> args;
118+ if (!deserialize_all<Args...>(unpacker, args)) return false ;
120119 MsgPack::object::nil_t nil;
121120 invoke_with_tuple (_func, args, arx::stdx::make_index_sequence<sizeof ...(Args)>{});
122121 packer.serialize (nil, nil);
@@ -125,7 +124,10 @@ class RpcFunctionWrapper<R(Args...)>: public IFunctionWrapper {
125124
126125 template <typename Dummy = R>
127126 typename std::enable_if<!std::is_void<Dummy>::value, bool >::type
128- handle_call (auto && args, auto && packer) {
127+ handle_call (MsgPack::Unpacker& unpacker, MsgPack::Packer& packer) {
128+ // unpacker not ready if deserialization fails at this point
129+ std::tuple<Args...> args;
130+ if (!deserialize_all<Args...>(unpacker, args)) return false ;
129131 MsgPack::object::nil_t nil;
130132 R out = invoke_with_tuple (_func, args, arx::stdx::make_index_sequence<sizeof ...(Args)>{});
131133 packer.serialize (nil, out);
0 commit comments