Skip to content

Commit cdef8bc

Browse files
authored
Merge pull request #222 from kurdybacha/poller-init
Problem: poller's constructor is not default generated
2 parents e972f39 + c03fb35 commit cdef8bc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

zmq.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,12 +1022,7 @@ namespace zmq
10221022
class poller_t
10231023
{
10241024
public:
1025-
poller_t ()
1026-
{
1027-
if (!poller_ptr)
1028-
throw error_t ();
1029-
}
1030-
1025+
poller_t () = default;
10311026
~poller_t () = default;
10321027

10331028
poller_t(const poller_t&) = delete;
@@ -1116,7 +1111,12 @@ namespace zmq
11161111
private:
11171112
std::unique_ptr<void, std::function<void(void*)>> poller_ptr
11181113
{
1119-
zmq_poller_new (),
1114+
[]() {
1115+
auto poller_new = zmq_poller_new ();
1116+
if (poller_new)
1117+
return poller_new;
1118+
throw error_t ();
1119+
}(),
11201120
[](void *ptr) {
11211121
int rc = zmq_poller_destroy (&ptr);
11221122
ZMQ_ASSERT (rc == 0);

0 commit comments

Comments
 (0)