mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-12 18:40:28 +01:00
Merge pull request #415 from sigiesec/poll-array
Add poll overload accepting std::array
This commit is contained in:
commit
a2ef92ef57
8
zmq.hpp
8
zmq.hpp
@ -310,10 +310,18 @@ inline int poll(std::vector<zmq_pollitem_t> &items,
|
||||
return poll(items.data(), items.size(), static_cast<long>(timeout.count()));
|
||||
}
|
||||
|
||||
ZMQ_DEPRECATED("from 4.3.1, use poll taking std::chrono instead of long")
|
||||
inline int poll(std::vector<zmq_pollitem_t> &items, long timeout_ = -1)
|
||||
{
|
||||
return poll(items.data(), items.size(), timeout_);
|
||||
}
|
||||
|
||||
template<std::size_t SIZE>
|
||||
inline int poll(std::array<zmq_pollitem_t, SIZE>& items,
|
||||
std::chrono::milliseconds timeout)
|
||||
{
|
||||
return poll(items.data(), items.size(), static_cast<long>(timeout.count()));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user