Skip to content

Commit

Permalink
Added poll() overload accepting std::array
Browse files Browse the repository at this point in the history
  • Loading branch information
Critical2104 authored and sigiesec committed May 15, 2020
1 parent b495021 commit 8d35b8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ 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


Expand Down

0 comments on commit 8d35b8c

Please sign in to comment.