Skip to content

Commit f108be4

Browse files
committed
fix: no auto params
1 parent ace5a3e commit f108be4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/DummyTransport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class DummyTransport: public ITransport {
2424

2525
size_t write(const uint8_t* data, size_t size) override {
2626
// Mock write
27+
(void)data;
2728
return size;
2829
}
2930

src/wrapper.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)