File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ static_assert(!std::is_copy_constructible<zmq::poller_t<>>::value,
1919static_assert (!std::is_copy_assignable<zmq::poller_t <>>::value,
2020 " poller_t should not be copy-assignable" );
2121
22+ TEST_CASE (" event flags" , " [poller]" )
23+ {
24+ CHECK ((zmq::event_flags::pollin | zmq::event_flags::pollout)
25+ == static_cast <zmq::event_flags>(ZMQ_POLLIN | ZMQ_POLLOUT));
26+ CHECK ((zmq::event_flags::pollin & zmq::event_flags::pollout)
27+ == static_cast <zmq::event_flags>(ZMQ_POLLIN & ZMQ_POLLOUT));
28+ CHECK ((zmq::event_flags::pollin ^ zmq::event_flags::pollout)
29+ == static_cast <zmq::event_flags>(ZMQ_POLLIN ^ ZMQ_POLLOUT));
30+ CHECK (~zmq::event_flags::pollin == static_cast <zmq::event_flags>(~ZMQ_POLLIN));
31+ }
32+
2233TEST_CASE (" poller create destroy" , " [poller]" )
2334{
2435 zmq::poller_t <> a;
Original file line number Diff line number Diff line change @@ -1837,15 +1837,19 @@ enum class event_flags : short
18371837
18381838constexpr event_flags operator |(event_flags a, event_flags b) noexcept
18391839{
1840- return static_cast <event_flags>( static_cast < short >(a) | static_cast < short >(b) );
1840+ return detail::enum_bit_or (a, b );
18411841}
18421842constexpr event_flags operator &(event_flags a, event_flags b) noexcept
18431843{
1844- return static_cast <event_flags>(static_cast <short >(a) & static_cast <short >(b));
1844+ return detail::enum_bit_and (a, b);
1845+ }
1846+ constexpr event_flags operator ^(event_flags a, event_flags b) noexcept
1847+ {
1848+ return detail::enum_bit_xor (a, b);
18451849}
18461850constexpr event_flags operator ~(event_flags a) noexcept
18471851{
1848- return static_cast <event_flags>(~ static_cast < short >(a) );
1852+ return detail::enum_bit_not (a );
18491853}
18501854
18511855struct no_user_data ;
You can’t perform that action at this time.
0 commit comments