File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ TEST_CASE("poller remove registered non empty", "[poller]")
178178
179179const std::string hi_str = " Hi" ;
180180
181-
181+ # if CPPZMQ_HAS_OPTIONAL
182182TEST_CASE (" poller wait" , " [poller]" )
183183{
184184 common_server_client_setup s;
@@ -201,6 +201,7 @@ TEST_CASE("poller wait timeout", "[poller]")
201201 auto event = poller.wait (std::chrono::milliseconds{3 });
202202 CHECK (!event.has_value ());
203203}
204+ #endif
204205
205206TEST_CASE (" poller poll basic" , " [poller]" )
206207{
Original file line number Diff line number Diff line change @@ -2698,11 +2698,6 @@ template<typename T = no_user_data> class poller_t
26982698{
26992699 public:
27002700 using event_type = poller_event<T>;
2701- #if CPPZMQ_HAS_OPTIONAL
2702- using wait_result_t = std::optional<event_type>;
2703- #else
2704- using wait_result_t = detail::trivial_optional<event_type>;
2705- #endif
27062701
27072702 poller_t () : poller_ptr(zmq_poller_new())
27082703 {
@@ -2767,8 +2762,9 @@ template<typename T = no_user_data> class poller_t
27672762 }
27682763 }
27692764
2770- wait_result_t wait (std::chrono::milliseconds timeout = std::chrono::milliseconds{
2771- -1 })
2765+ #if CPPZMQ_HAS_OPTIONAL
2766+ std::optional<event_type>
2767+ wait (std::chrono::milliseconds timeout = std::chrono::milliseconds{-1 })
27722768 {
27732769 event_type event;
27742770 int rc = zmq_poller_wait (poller_ptr.get (),
@@ -2782,6 +2778,7 @@ template<typename T = no_user_data> class poller_t
27822778 }
27832779 return event;
27842780 }
2781+ #endif
27852782
27862783 template <typename Sequence>
27872784 size_t wait_all (Sequence &poller_events, const std::chrono::milliseconds timeout)
You can’t perform that action at this time.
0 commit comments