File tree 2 files changed +18
-3
lines changed
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,
19
19
static_assert (!std::is_copy_assignable<zmq::poller_t <>>::value,
20
20
" poller_t should not be copy-assignable" );
21
21
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
+
22
33
TEST_CASE (" poller create destroy" , " [poller]" )
23
34
{
24
35
zmq::poller_t <> a;
Original file line number Diff line number Diff line change @@ -1837,15 +1837,19 @@ enum class event_flags : short
1837
1837
1838
1838
constexpr event_flags operator |(event_flags a, event_flags b) noexcept
1839
1839
{
1840
- return static_cast <event_flags>( static_cast < short >(a) | static_cast < short >(b) );
1840
+ return detail::enum_bit_or (a, b );
1841
1841
}
1842
1842
constexpr event_flags operator &(event_flags a, event_flags b) noexcept
1843
1843
{
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);
1845
1849
}
1846
1850
constexpr event_flags operator ~(event_flags a) noexcept
1847
1851
{
1848
- return static_cast <event_flags>(~ static_cast < short >(a) );
1852
+ return detail::enum_bit_not (a );
1849
1853
}
1850
1854
1851
1855
struct no_user_data ;
You can’t perform that action at this time.
0 commit comments