Skip to content

Commit a2ef92e

Browse files
authored
Merge pull request #415 from sigiesec/poll-array
Add poll overload accepting std::array
2 parents b495021 + b0e7243 commit a2ef92e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

zmq.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,18 @@ inline int poll(std::vector<zmq_pollitem_t> &items,
310310
return poll(items.data(), items.size(), static_cast<long>(timeout.count()));
311311
}
312312

313+
ZMQ_DEPRECATED("from 4.3.1, use poll taking std::chrono instead of long")
313314
inline int poll(std::vector<zmq_pollitem_t> &items, long timeout_ = -1)
314315
{
315316
return poll(items.data(), items.size(), timeout_);
316317
}
318+
319+
template<std::size_t SIZE>
320+
inline int poll(std::array<zmq_pollitem_t, SIZE>& items,
321+
std::chrono::milliseconds timeout)
322+
{
323+
return poll(items.data(), items.size(), static_cast<long>(timeout.count()));
324+
}
317325
#endif
318326

319327

0 commit comments

Comments
 (0)