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 @@ -1836,15 +1836,19 @@ enum class event_flags : short
18361836
18371837constexpr event_flags operator |(event_flags a, event_flags b) noexcept
18381838{
1839- return static_cast <event_flags>( static_cast < short >(a) | static_cast < short >(b) );
1839+ return detail::enum_bit_or (a, b );
18401840}
18411841constexpr event_flags operator &(event_flags a, event_flags b) noexcept
18421842{
1843- return static_cast <event_flags>(static_cast <short >(a) & static_cast <short >(b));
1843+ return detail::enum_bit_and (a, b);
1844+ }
1845+ constexpr event_flags operator ^(event_flags a, event_flags b) noexcept
1846+ {
1847+ return detail::enum_bit_xor (a, b);
18441848}
18451849constexpr event_flags operator ~(event_flags a) noexcept
18461850{
1847- return static_cast <event_flags>(~ static_cast < short >(a) );
1851+ return detail::enum_bit_not (a );
18481852}
18491853
18501854struct no_user_data ;
You can’t perform that action at this time.
0 commit comments