Skip to content

Commit 381fed7

Browse files
committed
feat: overloaded RpcResult.result() waits a msgpack nil result
feat: RpcResult destructor invokes .result()
1 parent 744fb96 commit 381fed7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/bridge.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,19 @@ class RpcResult {
6060
return error.code == NO_ERR;
6161
}
6262

63-
operator bool() {
63+
bool result() {
6464
MsgPack::object::nil_t nil;
6565
return result(nil);
6666
}
6767

68+
~RpcResult(){
69+
result();
70+
}
71+
72+
operator bool() {
73+
return result();
74+
}
75+
6876
private:
6977
uint32_t msg_id_wait;
7078
RPCClient* client;

0 commit comments

Comments
 (0)