Merge pull request #415 from sigiesec/poll-array

Add poll overload accepting std::array
This commit is contained in:
Simon Giesecke 2020-05-15 13:09:57 +02:00 committed by GitHub
commit a2ef92ef57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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