11 #ifndef ASIO_EXECUTION_CONNECT_HPP 12 #define ASIO_EXECUTION_CONNECT_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 19 #include "asio/detail/type_traits.hpp" 20 #include "asio/execution/detail/as_invocable.hpp" 21 #include "asio/execution/detail/as_operation.hpp" 22 #include "asio/execution/detail/as_receiver.hpp" 23 #include "asio/execution/executor.hpp" 24 #include "asio/execution/operation_state.hpp" 25 #include "asio/execution/receiver.hpp" 26 #include "asio/execution/sender.hpp" 27 #include "asio/traits/connect_member.hpp" 28 #include "asio/traits/connect_free.hpp" 30 #include "asio/detail/push_options.hpp" 32 #if defined(GENERATING_DOCUMENTATION) 97 inline constexpr unspecified
connect = unspecified;
106 template <
typename S,
typename R>
108 integral_constant<bool, automatically_determined>
113 template <
typename S,
typename R>
114 struct connect_result
121 typedef automatically_determined type;
125 template <
typename S,
typename R>
126 using connect_result_t =
typename connect_result<S, R>::type;
131 #else // defined(GENERATING_DOCUMENTATION) 135 using asio::conditional;
145 using asio::false_type;
160 template <
typename S,
typename R,
typename =
void>
163 ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
164 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
false);
165 typedef void result_type;
168 template <
typename S,
typename R>
176 is_sender<typename remove_cvref<S>::type>::value
181 ASIO_STATIC_CONSTEXPR(overload_type, overload = call_member);
184 template <
typename S,
typename R>
194 is_sender<typename remove_cvref<S>::type>::value
199 ASIO_STATIC_CONSTEXPR(overload_type, overload = call_free);
202 template <
typename S,
typename R>
214 typename remove_cvref<R>::type
217 typename remove_cvref<S>::type,
218 as_invocable<typename remove_cvref<R>::type, S>
225 ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter);
226 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
false);
232 #if defined(ASIO_HAS_MOVE) 233 template <
typename S,
typename R>
236 typename call_traits<S, void(R)>::result_type
238 operator()(S&&
s, R&& r)
const 242 return ASIO_MOVE_CAST(S)(
s).
connect(ASIO_MOVE_CAST(R)(r));
245 template <
typename S,
typename R>
247 call_traits<S, void(R)>::overload == call_free,
248 typename call_traits<S, void(R)>::result_type
250 operator()(S&&
s, R&& r)
const 254 return connect(ASIO_MOVE_CAST(S)(
s), ASIO_MOVE_CAST(R)(r));
257 template <
typename S,
typename R>
259 call_traits<S, void(R)>::overload == adapter,
260 typename call_traits<S, void(R)>::result_type
262 operator()(S&&
s, R&& r)
const 266 return typename call_traits<S, void(R)>::result_type(
267 ASIO_MOVE_CAST(S)(
s), ASIO_MOVE_CAST(R)(r));
269 #else // defined(ASIO_HAS_MOVE) 270 template <
typename S,
typename R>
273 typename call_traits<S&, void(R&)>::result_type
275 operator()(S&
s, R& r)
const 282 template <
typename S,
typename R>
285 typename call_traits<const S&, void(R&)>::result_type
287 operator()(
const S& s, R& r)
const 294 template <
typename S,
typename R>
296 call_traits<S&, void(R&)>::overload == call_free,
297 typename call_traits<S&, void(R&)>::result_type
299 operator()(S& s, R& r)
const 306 template <
typename S,
typename R>
308 call_traits<const S&, void(R&)>::overload == call_free,
309 typename call_traits<const S&, void(R&)>::result_type
311 operator()(
const S& s, R& r)
const 318 template <
typename S,
typename R>
320 call_traits<S&, void(R&)>::overload == adapter,
321 typename call_traits<S&, void(R&)>::result_type
323 operator()(S& s, R& r)
const 327 return typename call_traits<S&, void(R&)>::result_type(s, r);
330 template <
typename S,
typename R>
332 call_traits<const S&, void(R&)>::overload == adapter,
333 typename call_traits<const S&, void(R&)>::result_type
335 operator()(
const S& s, R& r)
const 339 return typename call_traits<const S&, void(R&)>::result_type(s, r);
342 template <
typename S,
typename R>
345 typename call_traits<S&, void(const R&)>::result_type
347 operator()(S& s,
const R& r)
const 354 template <
typename S,
typename R>
357 typename call_traits<const S&, void(const R&)>::result_type
359 operator()(
const S& s,
const R& r)
const 361 call_traits<
const S&,
void(
const R&)>::is_noexcept))
366 template <
typename S,
typename R>
368 call_traits<S&, void(const R&)>::overload == call_free,
369 typename call_traits<S&, void(const R&)>::result_type
371 operator()(S& s,
const R& r)
const 378 template <
typename S,
typename R>
380 call_traits<const S&, void(const R&)>::overload == call_free,
381 typename call_traits<const S&, void(const R&)>::result_type
383 operator()(
const S& s,
const R& r)
const 385 call_traits<
const S&,
void(
const R&)>::is_noexcept))
390 template <
typename S,
typename R>
392 call_traits<S&, void(const R&)>::overload == adapter,
393 typename call_traits<S&, void(const R&)>::result_type
395 operator()(S& s,
const R& r)
const 399 return typename call_traits<S&, void(const R&)>::result_type(s, r);
402 template <
typename S,
typename R>
404 call_traits<const S&, void(const R&)>::overload == adapter,
405 typename call_traits<const S&, void(const R&)>::result_type
407 operator()(
const S& s,
const R& r)
const 409 call_traits<
const S&,
void(
const R&)>::is_noexcept))
411 return typename call_traits<const S&, void(const R&)>::result_type(s, r);
413 #endif // defined(ASIO_HAS_MOVE) 416 template <
typename T = impl>
419 static const T instance;
422 template <
typename T>
435 template <
typename S,
typename R>
437 integral_constant<bool,
438 asio_execution_connect_fn::call_traits<S, void(R)>::overload !=
439 asio_execution_connect_fn::ill_formed>
443 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 445 template <
typename S,
typename R>
448 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 450 template <
typename S,
typename R>
452 integral_constant<bool,
453 asio_execution_connect_fn::call_traits<S, void(R)>::is_noexcept>
457 #if defined(ASIO_HAS_VARIABLE_TEMPLATES) 459 template <
typename S,
typename R>
460 constexpr
bool is_nothrow_connect_v
463 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES) 465 template <
typename S,
typename R>
469 S, void(R)>::result_type type;
472 #if defined(ASIO_HAS_ALIAS_TEMPLATES) 474 template <
typename S,
typename R>
475 using connect_result_t =
typename connect_result<S, R>::type;
477 #endif // defined(ASIO_HAS_ALIAS_TEMPLATES) 482 #endif // defined(GENERATING_DOCUMENTATION) 484 #include "asio/detail/pop_options.hpp" 486 #endif // ASIO_EXECUTION_CONNECT_HPP Definition: connect_free.hpp:38
Definition: as_invocable.hpp:84
Definition: blocking.hpp:208
The is_sender trait detects whether a type T satisfies the execution::sender concept.
Definition: sender.hpp:183
The is_executor_of trait detects whether a type T satisfies the execution::executor_of concept for so...
Definition: executor.hpp:147
The is_operation_state trait detects whether a type T satisfies the execution::operation_state concep...
Definition: operation_state.hpp:53
The is_receiver trait detects whether a type T satisfies the execution::receiver concept.
Definition: receiver.hpp:81
Definition: connect.hpp:230
Definition: connect.hpp:161
Definition: connect.hpp:133
Definition: type_traits.hpp:97
Definition: as_operation.hpp:33
Definition: connect_member.hpp:38
Definition: connect.hpp:466
Definition: connect.hpp:451
Definition: connect.hpp:436
Iterator connect(basic_socket< Protocol, Executor > &s, Iterator begin, Iterator end, ConnectCondition connect_condition, asio::error_code &ec)
Establishes a socket connection by trying each endpoint in a sequence.
Definition: connect.hpp:229
Definition: connect.hpp:417
Definition: handler_work.hpp:37
Definition: type_traits.hpp:128
Definition: as_receiver.hpp:66
Definition: any_io_executor.hpp:28