11 #ifndef ASIO_TRAITS_CONNECT_MEMBER_HPP 12 #define ASIO_TRAITS_CONNECT_MEMBER_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" 21 #if defined(ASIO_HAS_DECLTYPE) \ 22 && defined(ASIO_HAS_NOEXCEPT) \ 23 && defined(ASIO_HAS_WORKING_EXPRESSION_SFINAE) 24 # define ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT 1 25 #endif // defined(ASIO_HAS_DECLTYPE) 29 #include "asio/detail/push_options.hpp" 34 template <
typename S,
typename R,
typename =
void>
37 template <
typename S,
typename R,
typename =
void>
45 ASIO_STATIC_CONSTEXPR(
bool, is_valid =
false);
46 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept =
false);
49 #if defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT) 51 template <
typename S,
typename R,
typename =
void>
56 template <
typename S,
typename R>
59 decltype(declval<S>().connect(declval<R>()))
62 ASIO_STATIC_CONSTEXPR(
bool, is_valid =
true);
64 using result_type = decltype(
65 declval<S>().
connect(declval<R>()));
67 ASIO_STATIC_CONSTEXPR(
bool, is_noexcept = noexcept(
68 declval<S>().
connect(declval<R>())));
71 #else // defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT) 73 template <
typename S,
typename R,
typename =
void>
76 is_same<S, typename remove_reference<S>::type>::value
77 && is_same<R, typename decay<R>::type>::value,
79 is_same<S, typename add_const<S>::type>::value,
81 traits::connect_member<typename add_const<S>::type, R>
83 traits::connect_member<
84 typename remove_reference<S>::type,
85 typename decay<R>::type>
90 #endif // defined(ASIO_HAS_DEDUCED_CONNECT_MEMBER_TRAIT) 95 template <
typename S,
typename R,
typename>
96 struct connect_member_default :
101 template <
typename S,
typename R,
typename>
102 struct connect_member :
103 connect_member_default<S, R>
110 #include "asio/detail/pop_options.hpp" 112 #endif // ASIO_TRAITS_CONNECT_MEMBER_HPP Definition: connect_member.hpp:35
Definition: connect_member.hpp:43
Definition: connect_member.hpp:38
Definition: connect_member.hpp:74
Protocol::endpoint connect(basic_socket< Protocol, Executor > &s, const EndpointSequence &endpoints, typename enable_if< is_endpoint_sequence< EndpointSequence >::value >::type *=0)
Establishes a socket connection by trying each endpoint in a sequence.
Definition: connect.hpp:106
Definition: any_io_executor.hpp:28