You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: zmq.hpp
+15-12Lines changed: 15 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -536,6 +536,11 @@ namespace zmq
536
536
{
537
537
return ptr;
538
538
}
539
+
540
+
inlineoperatorbool() const ZMQ_NOTHROW
541
+
{
542
+
return ptr != NULL;
543
+
}
539
544
private:
540
545
541
546
void *ptr;
@@ -1053,26 +1058,24 @@ namespace zmq
1053
1058
1054
1059
voidadd (zmq::socket_t &socket, short events, handler_t handler)
1055
1060
{
1056
-
handler_t *handler_ptr = nullptr;
1057
-
/// \todo is it sensible to allow handler to be empty? doesn't this lead to an error when the event is signalled? (perhaps it should already lead to an error in zmq_poller_add then)
1058
-
if (handler) {
1059
-
auto emplace_res = handlers.emplace(&socket, std::move(handler));
1060
-
handler_ptr = &emplace_res.first->second;
1061
-
}
1062
-
if (0 == zmq_poller_add (poller_ptr, socket.ptr, handler_ptr, events)) {
0 commit comments