We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 838a7db commit ae2c885Copy full SHA for ae2c885
src/dispatcher.h
@@ -16,8 +16,9 @@ class RpcFunctionDispatcher {
16
template<typename F>
17
bool bind(MsgPack::str_t name, F&& f) {
18
if (_count >= N) return false;
19
- static auto wrapper = wrap(std::forward<F>(f));
20
- _entries[_count++] = {name, &wrapper};
+ using WrapperT = decltype(wrap(std::forward<F>(f)));
+ WrapperT* instance = new WrapperT(wrap(std::forward<F>(f)));
21
+ _entries[_count++] = {name, instance};
22
return true;
23
}
24
0 commit comments