mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-10-16 18:56:56 +02:00
Problem: poller_t's deprecated add might throw std::bad_function_call
Issue is reproducible in deprecated add method with empty handler followed by wait that kicks in (covered by provided unit test). I would prefer we remove this method completely as maintaining something that we consider `deprecated` is unnecessary in `draft` API.
This commit is contained in:
3
zmq.hpp
3
zmq.hpp
@@ -1053,7 +1053,8 @@ namespace zmq
|
||||
ZMQ_DEPRECATED("from 4.3.0, use overload accepting handler_t instead")
|
||||
void add (zmq::socket_t &socket, short events, std::function<void(void)> &handler)
|
||||
{
|
||||
add (socket, events, [&handler](short) { handler(); });
|
||||
add (socket, events, handler ? [&handler](short) { handler(); }
|
||||
: handler_t{});
|
||||
}
|
||||
|
||||
void add (zmq::socket_t &socket, short events, handler_t handler)
|
||||
|
Reference in New Issue
Block a user