Use constraint<> rather than enable_if<> in public SFINAE-constrained functions.

This commit is contained in:
Christopher Kohlhoff 2021-03-03 18:50:44 +11:00
parent b5a8065ecc
commit 6c177789f8
47 changed files with 631 additions and 610 deletions

View File

@ -119,7 +119,7 @@ public:
#else // defined(GENERATING_DOCUMENTATION) #else // defined(GENERATING_DOCUMENTATION)
template <typename OtherAnyExecutor> template <typename OtherAnyExecutor>
any_io_executor(OtherAnyExecutor e, any_io_executor(OtherAnyExecutor e,
typename enable_if< typename constraint<
conditional< conditional<
!is_same<OtherAnyExecutor, any_io_executor>::value !is_same<OtherAnyExecutor, any_io_executor>::value
&& is_base_of<execution::detail::any_executor_base, && is_base_of<execution::detail::any_executor_base,
@ -129,7 +129,7 @@ public:
is_valid_target<OtherAnyExecutor>, is_valid_target<OtherAnyExecutor>,
false_type false_type
>::type::value >::type::value
>::type* = 0) >::type = 0)
: base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e)) : base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e))
{ {
} }
@ -142,7 +142,7 @@ public:
#else // defined(GENERATING_DOCUMENTATION) #else // defined(GENERATING_DOCUMENTATION)
template <ASIO_EXECUTION_EXECUTOR Executor> template <ASIO_EXECUTION_EXECUTOR Executor>
any_io_executor(Executor e, any_io_executor(Executor e,
typename enable_if< typename constraint<
conditional< conditional<
!is_same<Executor, any_io_executor>::value !is_same<Executor, any_io_executor>::value
&& !is_base_of<execution::detail::any_executor_base, && !is_base_of<execution::detail::any_executor_base,
@ -151,7 +151,7 @@ public:
Executor, supportable_properties_type>, Executor, supportable_properties_type>,
false_type false_type
>::type::value >::type::value
>::type* = 0) >::type = 0)
: base_type(ASIO_MOVE_CAST(Executor)(e)) : base_type(ASIO_MOVE_CAST(Executor)(e))
{ {
} }
@ -202,9 +202,9 @@ public:
*/ */
template <typename Property> template <typename Property>
any_io_executor require(const Property& p, any_io_executor require(const Property& p,
typename enable_if< typename constraint<
traits::require_member<const base_type&, const Property&>::is_valid traits::require_member<const base_type&, const Property&>::is_valid
>::type* = 0) const >::type = 0) const
{ {
return static_cast<const base_type&>(*this).require(p); return static_cast<const base_type&>(*this).require(p);
} }
@ -220,9 +220,9 @@ public:
*/ */
template <typename Property> template <typename Property>
any_io_executor prefer(const Property& p, any_io_executor prefer(const Property& p,
typename enable_if< typename constraint<
traits::prefer_member<const base_type&, const Property&>::is_valid traits::prefer_member<const base_type&, const Property&>::is_valid
>::type* = 0) const >::type = 0) const
{ {
return static_cast<const base_type&>(*this).prefer(p); return static_cast<const base_type&>(*this).prefer(p);
} }

View File

@ -108,9 +108,9 @@ get_associated_executor(const T& t) ASIO_NOEXCEPT
template <typename T, typename Executor> template <typename T, typename Executor>
inline typename associated_executor<T, Executor>::type inline typename associated_executor<T, Executor>::type
get_associated_executor(const T& t, const Executor& ex, get_associated_executor(const T& t, const Executor& ex,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return associated_executor<T, Executor>::get(t, ex); return associated_executor<T, Executor>::get(t, ex);
} }
@ -124,8 +124,8 @@ template <typename T, typename ExecutionContext>
inline typename associated_executor<T, inline typename associated_executor<T,
typename ExecutionContext::executor_type>::type typename ExecutionContext::executor_type>::type
get_associated_executor(const T& t, ExecutionContext& ctx, get_associated_executor(const T& t, ExecutionContext& ctx,
typename enable_if<is_convertible<ExecutionContext&, typename constraint<is_convertible<ExecutionContext&,
execution_context&>::value>::type* = 0) ASIO_NOEXCEPT execution_context&>::value>::type = 0) ASIO_NOEXCEPT
{ {
return associated_executor<T, return associated_executor<T,
typename ExecutionContext::executor_type>::get(t, ctx.get_executor()); typename ExecutionContext::executor_type>::get(t, ctx.get_executor());

View File

@ -349,7 +349,7 @@ void_or_deduced async_initiate(
template <typename CompletionToken, template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE Signature, ASIO_COMPLETION_SIGNATURE Signature,
typename Initiation, typename... Args> typename Initiation, typename... Args>
inline typename enable_if< inline typename constraint<
detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
(async_result<typename decay<CompletionToken>::type, (async_result<typename decay<CompletionToken>::type,
@ -369,7 +369,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
template <typename CompletionToken, template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE Signature, ASIO_COMPLETION_SIGNATURE Signature,
typename Initiation, typename... Args> typename Initiation, typename... Args>
inline typename enable_if< inline typename constraint<
!detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, !detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
async_initiate(ASIO_MOVE_ARG(Initiation) initiation, async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
@ -391,7 +391,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
template <typename CompletionToken, template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE Signature, ASIO_COMPLETION_SIGNATURE Signature,
typename Initiation> typename Initiation>
inline typename enable_if< inline typename constraint<
detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
(async_result<typename decay<CompletionToken>::type, (async_result<typename decay<CompletionToken>::type,
@ -408,7 +408,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
template <typename CompletionToken, template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE Signature, ASIO_COMPLETION_SIGNATURE Signature,
typename Initiation> typename Initiation>
inline typename enable_if< inline typename constraint<
!detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, !detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
async_initiate(ASIO_MOVE_ARG(Initiation) initiation, async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
@ -427,7 +427,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
template <typename CompletionToken, \ template <typename CompletionToken, \
ASIO_COMPLETION_SIGNATURE Signature, \ ASIO_COMPLETION_SIGNATURE Signature, \
typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \ typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
inline typename enable_if< \ inline typename constraint< \
detail::async_result_has_initiate_memfn< \ detail::async_result_has_initiate_memfn< \
CompletionToken, Signature>::value, \ CompletionToken, Signature>::value, \
ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, \ ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, \
@ -448,7 +448,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
template <typename CompletionToken, \ template <typename CompletionToken, \
ASIO_COMPLETION_SIGNATURE Signature, \ ASIO_COMPLETION_SIGNATURE Signature, \
typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \ typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
inline typename enable_if< \ inline typename constraint< \
!detail::async_result_has_initiate_memfn< \ !detail::async_result_has_initiate_memfn< \
CompletionToken, Signature>::value, \ CompletionToken, Signature>::value, \
ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \ ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \

View File

@ -107,9 +107,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_datagram_socket(ExecutionContext& context, explicit basic_datagram_socket(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context) : basic_socket<Protocol, Executor>(context)
{ {
} }
@ -145,9 +145,10 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_datagram_socket(ExecutionContext& context, basic_datagram_socket(ExecutionContext& context,
const protocol_type& protocol, const protocol_type& protocol,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol) : basic_socket<Protocol, Executor>(context, protocol)
{ {
} }
@ -191,9 +192,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_datagram_socket(ExecutionContext& context, basic_datagram_socket(ExecutionContext& context,
const endpoint_type& endpoint, const endpoint_type& endpoint,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, endpoint) : basic_socket<Protocol, Executor>(context, endpoint)
{ {
} }
@ -236,9 +237,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_datagram_socket(ExecutionContext& context, basic_datagram_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket, const protocol_type& protocol, const native_handle_type& native_socket,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket) : basic_socket<Protocol, Executor>(context, protocol, native_socket)
{ {
} }
@ -292,10 +293,10 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
basic_datagram_socket(basic_datagram_socket<Protocol1, Executor1>&& other, basic_datagram_socket(basic_datagram_socket<Protocol1, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value && is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(std::move(other)) : basic_socket<Protocol, Executor>(std::move(other))
{ {
} }
@ -314,7 +315,7 @@ public:
* constructor. * constructor.
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value, && is_convertible<Executor1, Executor>::value,
basic_datagram_socket& basic_datagram_socket&

View File

@ -175,9 +175,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_deadline_timer(ExecutionContext& context, explicit basic_deadline_timer(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -213,9 +213,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_deadline_timer(ExecutionContext& context, const time_type& expiry_time, basic_deadline_timer(ExecutionContext& context, const time_type& expiry_time,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -257,9 +257,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_deadline_timer(ExecutionContext& context, basic_deadline_timer(ExecutionContext& context,
const duration_type& expiry_time, const duration_type& expiry_time,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;

View File

@ -107,9 +107,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_raw_socket(ExecutionContext& context, explicit basic_raw_socket(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context) : basic_socket<Protocol, Executor>(context)
{ {
} }
@ -144,9 +144,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_raw_socket(ExecutionContext& context, const protocol_type& protocol, basic_raw_socket(ExecutionContext& context, const protocol_type& protocol,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol) : basic_socket<Protocol, Executor>(context, protocol)
{ {
} }
@ -189,9 +190,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_raw_socket(ExecutionContext& context, const endpoint_type& endpoint, basic_raw_socket(ExecutionContext& context, const endpoint_type& endpoint,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, endpoint) : basic_socket<Protocol, Executor>(context, endpoint)
{ {
} }
@ -234,9 +235,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_raw_socket(ExecutionContext& context, basic_raw_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket, const protocol_type& protocol, const native_handle_type& native_socket,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket) : basic_socket<Protocol, Executor>(context, protocol, native_socket)
{ {
} }
@ -289,10 +290,10 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
basic_raw_socket(basic_raw_socket<Protocol1, Executor1>&& other, basic_raw_socket(basic_raw_socket<Protocol1, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value && is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(std::move(other)) : basic_socket<Protocol, Executor>(std::move(other))
{ {
} }
@ -309,7 +310,7 @@ public:
* constructor. * constructor.
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value, && is_convertible<Executor1, Executor>::value,
basic_raw_socket& basic_raw_socket&

View File

@ -106,9 +106,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_seq_packet_socket(ExecutionContext& context, explicit basic_seq_packet_socket(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context) : basic_socket<Protocol, Executor>(context)
{ {
} }
@ -149,9 +149,10 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_seq_packet_socket(ExecutionContext& context, basic_seq_packet_socket(ExecutionContext& context,
const protocol_type& protocol, const protocol_type& protocol,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol) : basic_socket<Protocol, Executor>(context, protocol)
{ {
} }
@ -196,9 +197,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_seq_packet_socket(ExecutionContext& context, basic_seq_packet_socket(ExecutionContext& context,
const endpoint_type& endpoint, const endpoint_type& endpoint,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, endpoint) : basic_socket<Protocol, Executor>(context, endpoint)
{ {
} }
@ -241,9 +242,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_seq_packet_socket(ExecutionContext& context, basic_seq_packet_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket, const protocol_type& protocol, const native_handle_type& native_socket,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket) : basic_socket<Protocol, Executor>(context, protocol, native_socket)
{ {
} }
@ -299,10 +300,10 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
basic_seq_packet_socket(basic_seq_packet_socket<Protocol1, Executor1>&& other, basic_seq_packet_socket(basic_seq_packet_socket<Protocol1, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value && is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(std::move(other)) : basic_socket<Protocol, Executor>(std::move(other))
{ {
} }
@ -321,7 +322,7 @@ public:
* constructor. * constructor.
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value, && is_convertible<Executor1, Executor>::value,
basic_seq_packet_socket& basic_seq_packet_socket&

View File

@ -108,10 +108,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_serial_port(ExecutionContext& context, explicit basic_serial_port(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value, is_convertible<ExecutionContext&, execution_context&>::value,
basic_serial_port defaulted_constraint
>::type* = 0) >::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -150,9 +150,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_serial_port(ExecutionContext& context, const char* device, basic_serial_port(ExecutionContext& context, const char* device,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -194,9 +194,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_serial_port(ExecutionContext& context, const std::string& device, basic_serial_port(ExecutionContext& context, const std::string& device,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -243,9 +243,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_serial_port(ExecutionContext& context, basic_serial_port(ExecutionContext& context,
const native_handle_type& native_serial_port, const native_handle_type& native_serial_port,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;

View File

@ -130,9 +130,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_signal_set(ExecutionContext& context, explicit basic_signal_set(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -175,9 +176,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_signal_set(ExecutionContext& context, int signal_number_1, basic_signal_set(ExecutionContext& context, int signal_number_1,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -233,9 +235,10 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_signal_set(ExecutionContext& context, int signal_number_1, basic_signal_set(ExecutionContext& context, int signal_number_1,
int signal_number_2, int signal_number_2,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -301,9 +304,10 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_signal_set(ExecutionContext& context, int signal_number_1, basic_signal_set(ExecutionContext& context, int signal_number_1,
int signal_number_2, int signal_number_3, int signal_number_2, int signal_number_3,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;

View File

@ -125,9 +125,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_socket(ExecutionContext& context, explicit basic_socket(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -165,9 +165,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_socket(ExecutionContext& context, const protocol_type& protocol, basic_socket(ExecutionContext& context, const protocol_type& protocol,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -219,9 +220,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_socket(ExecutionContext& context, const endpoint_type& endpoint, basic_socket(ExecutionContext& context, const endpoint_type& endpoint,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -272,9 +273,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_socket(ExecutionContext& context, const protocol_type& protocol, basic_socket(ExecutionContext& context, const protocol_type& protocol,
const native_handle_type& native_socket, const native_handle_type& native_socket,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -331,10 +332,10 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
basic_socket(basic_socket<Protocol1, Executor1>&& other, basic_socket(basic_socket<Protocol1, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value && is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: impl_(std::move(other.impl_)) : impl_(std::move(other.impl_))
{ {
} }
@ -350,7 +351,7 @@ public:
* constructed using the @c basic_socket(const executor_type&) constructor. * constructed using the @c basic_socket(const executor_type&) constructor.
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value, && is_convertible<Executor1, Executor>::value,
basic_socket& basic_socket&

View File

@ -141,9 +141,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_socket_acceptor(ExecutionContext& context, explicit basic_socket_acceptor(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -183,9 +183,10 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_socket_acceptor(ExecutionContext& context, basic_socket_acceptor(ExecutionContext& context,
const protocol_type& protocol, const protocol_type& protocol,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -271,9 +272,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_socket_acceptor(ExecutionContext& context, basic_socket_acceptor(ExecutionContext& context,
const endpoint_type& endpoint, bool reuse_addr = true, const endpoint_type& endpoint, bool reuse_addr = true,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -336,9 +337,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_socket_acceptor(ExecutionContext& context, basic_socket_acceptor(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_acceptor, const protocol_type& protocol, const native_handle_type& native_acceptor,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -399,10 +400,10 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
basic_socket_acceptor(basic_socket_acceptor<Protocol1, Executor1>&& other, basic_socket_acceptor(basic_socket_acceptor<Protocol1, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value && is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: impl_(std::move(other.impl_)) : impl_(std::move(other.impl_))
{ {
} }
@ -420,7 +421,7 @@ public:
* constructor. * constructor.
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value, && is_convertible<Executor1, Executor>::value,
basic_socket_acceptor& basic_socket_acceptor&
@ -1258,9 +1259,9 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
void accept(basic_socket<Protocol1, Executor1>& peer, void accept(basic_socket<Protocol1, Executor1>& peer,
typename enable_if< typename constraint<
is_convertible<Protocol, Protocol1>::value is_convertible<Protocol, Protocol1>::value
>::type* = 0) >::type = 0)
{ {
asio::error_code ec; asio::error_code ec;
impl_.get_service().accept(impl_.get_implementation(), impl_.get_service().accept(impl_.get_implementation(),
@ -1294,9 +1295,9 @@ public:
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
ASIO_SYNC_OP_VOID accept( ASIO_SYNC_OP_VOID accept(
basic_socket<Protocol1, Executor1>& peer, asio::error_code& ec, basic_socket<Protocol1, Executor1>& peer, asio::error_code& ec,
typename enable_if< typename constraint<
is_convertible<Protocol, Protocol1>::value is_convertible<Protocol, Protocol1>::value
>::type* = 0) >::type = 0)
{ {
impl_.get_service().accept(impl_.get_implementation(), impl_.get_service().accept(impl_.get_implementation(),
peer, static_cast<endpoint_type*>(0), ec); peer, static_cast<endpoint_type*>(0), ec);
@ -1349,9 +1350,9 @@ public:
async_accept(basic_socket<Protocol1, Executor1>& peer, async_accept(basic_socket<Protocol1, Executor1>& peer,
ASIO_MOVE_ARG(AcceptHandler) handler ASIO_MOVE_ARG(AcceptHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
typename enable_if< typename constraint<
is_convertible<Protocol, Protocol1>::value is_convertible<Protocol, Protocol1>::value
>::type* = 0) >::type = 0)
{ {
return async_initiate<AcceptHandler, void (asio::error_code)>( return async_initiate<AcceptHandler, void (asio::error_code)>(
initiate_async_accept(this), handler, initiate_async_accept(this), handler,
@ -1624,10 +1625,10 @@ public:
template <typename Executor1> template <typename Executor1>
typename Protocol::socket::template rebind_executor<Executor1>::other typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const Executor1& ex, accept(const Executor1& ex,
typename enable_if< typename constraint<
is_executor<Executor1>::value is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value || execution::is_executor<Executor1>::value
>::type* = 0) >::type = 0)
{ {
asio::error_code ec; asio::error_code ec;
typename Protocol::socket::template typename Protocol::socket::template
@ -1664,9 +1665,9 @@ public:
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context, accept(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
asio::error_code ec; asio::error_code ec;
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
@ -1707,10 +1708,10 @@ public:
template <typename Executor1> template <typename Executor1>
typename Protocol::socket::template rebind_executor<Executor1>::other typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const Executor1& ex, asio::error_code& ec, accept(const Executor1& ex, asio::error_code& ec,
typename enable_if< typename constraint<
is_executor<Executor1>::value is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value || execution::is_executor<Executor1>::value
>::type* = 0) >::type = 0)
{ {
typename Protocol::socket::template typename Protocol::socket::template
rebind_executor<Executor1>::other peer(ex); rebind_executor<Executor1>::other peer(ex);
@ -1750,9 +1751,9 @@ public:
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context, asio::error_code& ec, accept(ExecutionContext& context, asio::error_code& ec,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other peer(context); typename ExecutionContext::executor_type>::other peer(context);
@ -1814,10 +1815,10 @@ public:
async_accept(const Executor1& ex, async_accept(const Executor1& ex,
ASIO_MOVE_ARG(MoveAcceptHandler) handler ASIO_MOVE_ARG(MoveAcceptHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
typename enable_if< typename constraint<
is_executor<Executor1>::value is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value || execution::is_executor<Executor1>::value
>::type* = 0) >::type = 0)
{ {
typedef typename Protocol::socket::template rebind_executor< typedef typename Protocol::socket::template rebind_executor<
Executor1>::other other_socket_type; Executor1>::other other_socket_type;
@ -1884,9 +1885,9 @@ public:
async_accept(ExecutionContext& context, async_accept(ExecutionContext& context,
ASIO_MOVE_ARG(MoveAcceptHandler) handler ASIO_MOVE_ARG(MoveAcceptHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
typedef typename Protocol::socket::template rebind_executor< typedef typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other other_socket_type; typename ExecutionContext::executor_type>::other other_socket_type;
@ -2073,10 +2074,10 @@ public:
template <typename Executor1> template <typename Executor1>
typename Protocol::socket::template rebind_executor<Executor1>::other typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const Executor1& ex, endpoint_type& peer_endpoint, accept(const Executor1& ex, endpoint_type& peer_endpoint,
typename enable_if< typename constraint<
is_executor<Executor1>::value is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value || execution::is_executor<Executor1>::value
>::type* = 0) >::type = 0)
{ {
asio::error_code ec; asio::error_code ec;
typename Protocol::socket::template typename Protocol::socket::template
@ -2119,9 +2120,9 @@ public:
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context, endpoint_type& peer_endpoint, accept(ExecutionContext& context, endpoint_type& peer_endpoint,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
asio::error_code ec; asio::error_code ec;
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
@ -2169,10 +2170,10 @@ public:
typename Protocol::socket::template rebind_executor<Executor1>::other typename Protocol::socket::template rebind_executor<Executor1>::other
accept(const executor_type& ex, accept(const executor_type& ex,
endpoint_type& peer_endpoint, asio::error_code& ec, endpoint_type& peer_endpoint, asio::error_code& ec,
typename enable_if< typename constraint<
is_executor<Executor1>::value is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value || execution::is_executor<Executor1>::value
>::type* = 0) >::type = 0)
{ {
typename Protocol::socket::template typename Protocol::socket::template
rebind_executor<Executor1>::other peer(ex); rebind_executor<Executor1>::other peer(ex);
@ -2219,9 +2220,9 @@ public:
typename ExecutionContext::executor_type>::other typename ExecutionContext::executor_type>::other
accept(ExecutionContext& context, accept(ExecutionContext& context,
endpoint_type& peer_endpoint, asio::error_code& ec, endpoint_type& peer_endpoint, asio::error_code& ec,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
typename Protocol::socket::template rebind_executor< typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other peer(context); typename ExecutionContext::executor_type>::other peer(context);
@ -2290,10 +2291,10 @@ public:
async_accept(const Executor1& ex, endpoint_type& peer_endpoint, async_accept(const Executor1& ex, endpoint_type& peer_endpoint,
ASIO_MOVE_ARG(MoveAcceptHandler) handler ASIO_MOVE_ARG(MoveAcceptHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
typename enable_if< typename constraint<
is_executor<Executor1>::value is_executor<Executor1>::value
|| execution::is_executor<Executor1>::value || execution::is_executor<Executor1>::value
>::type* = 0) >::type = 0)
{ {
typedef typename Protocol::socket::template rebind_executor< typedef typename Protocol::socket::template rebind_executor<
Executor1>::other other_socket_type; Executor1>::other other_socket_type;
@ -2367,9 +2368,9 @@ public:
endpoint_type& peer_endpoint, endpoint_type& peer_endpoint,
ASIO_MOVE_ARG(MoveAcceptHandler) handler ASIO_MOVE_ARG(MoveAcceptHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type), ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
typedef typename Protocol::socket::template rebind_executor< typedef typename Protocol::socket::template rebind_executor<
typename ExecutionContext::executor_type>::other other_socket_type; typename ExecutionContext::executor_type>::other other_socket_type;

View File

@ -111,9 +111,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_stream_socket(ExecutionContext& context, explicit basic_stream_socket(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context) : basic_socket<Protocol, Executor>(context)
{ {
} }
@ -150,9 +150,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_stream_socket(ExecutionContext& context, const protocol_type& protocol, basic_stream_socket(ExecutionContext& context, const protocol_type& protocol,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: basic_socket<Protocol, Executor>(context, protocol) : basic_socket<Protocol, Executor>(context, protocol)
{ {
} }
@ -195,9 +196,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
basic_stream_socket(ExecutionContext& context, const endpoint_type& endpoint, basic_stream_socket(ExecutionContext& context, const endpoint_type& endpoint,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, endpoint) : basic_socket<Protocol, Executor>(context, endpoint)
{ {
} }
@ -240,9 +241,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_stream_socket(ExecutionContext& context, basic_stream_socket(ExecutionContext& context,
const protocol_type& protocol, const native_handle_type& native_socket, const protocol_type& protocol, const native_handle_type& native_socket,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(context, protocol, native_socket) : basic_socket<Protocol, Executor>(context, protocol, native_socket)
{ {
} }
@ -295,10 +296,10 @@ public:
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
basic_stream_socket(basic_stream_socket<Protocol1, Executor1>&& other, basic_stream_socket(basic_stream_socket<Protocol1, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value && is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: basic_socket<Protocol, Executor>(std::move(other)) : basic_socket<Protocol, Executor>(std::move(other))
{ {
} }
@ -315,7 +316,7 @@ public:
* constructor. * constructor.
*/ */
template <typename Protocol1, typename Executor1> template <typename Protocol1, typename Executor1>
typename enable_if< typename constraint<
is_convertible<Protocol1, Protocol>::value is_convertible<Protocol1, Protocol>::value
&& is_convertible<Executor1, Executor>::value, && is_convertible<Executor1, Executor>::value,
basic_stream_socket& basic_stream_socket&

View File

@ -191,9 +191,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_waitable_timer(ExecutionContext& context, explicit basic_waitable_timer(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -230,9 +230,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_waitable_timer(ExecutionContext& context, explicit basic_waitable_timer(ExecutionContext& context,
const time_point& expiry_time, const time_point& expiry_time,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -273,9 +273,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_waitable_timer(ExecutionContext& context, explicit basic_waitable_timer(ExecutionContext& context,
const duration& expiry_time, const duration& expiry_time,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;
@ -337,9 +337,9 @@ public:
template <typename Executor1> template <typename Executor1>
basic_waitable_timer( basic_waitable_timer(
basic_waitable_timer<Clock, WaitTraits, Executor1>&& other, basic_waitable_timer<Clock, WaitTraits, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Executor1, Executor>::value is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: impl_(std::move(other.impl_)) : impl_(std::move(other.impl_))
{ {
} }
@ -357,7 +357,7 @@ public:
* constructor. * constructor.
*/ */
template <typename Executor1> template <typename Executor1>
typename enable_if< typename constraint<
is_convertible<Executor1, Executor>::value, is_convertible<Executor1, Executor>::value,
basic_waitable_timer& basic_waitable_timer&
>::type operator=(basic_waitable_timer<Clock, WaitTraits, Executor1>&& other) >::type operator=(basic_waitable_timer<Clock, WaitTraits, Executor1>&& other)

View File

@ -488,9 +488,9 @@ private:
template <typename Executor, typename T> template <typename Executor, typename T>
inline executor_binder<typename decay<T>::type, Executor> inline executor_binder<typename decay<T>::type, Executor>
bind_executor(const Executor& ex, ASIO_MOVE_ARG(T) t, bind_executor(const Executor& ex, ASIO_MOVE_ARG(T) t,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0) >::type = 0)
{ {
return executor_binder<typename decay<T>::type, Executor>( return executor_binder<typename decay<T>::type, Executor>(
executor_arg_t(), ex, ASIO_MOVE_CAST(T)(t)); executor_arg_t(), ex, ASIO_MOVE_CAST(T)(t));
@ -501,8 +501,8 @@ template <typename ExecutionContext, typename T>
inline executor_binder<typename decay<T>::type, inline executor_binder<typename decay<T>::type,
typename ExecutionContext::executor_type> typename ExecutionContext::executor_type>
bind_executor(ExecutionContext& ctx, ASIO_MOVE_ARG(T) t, bind_executor(ExecutionContext& ctx, ASIO_MOVE_ARG(T) t,
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type* = 0) ExecutionContext&, execution_context&>::value>::type = 0)
{ {
return executor_binder<typename decay<T>::type, return executor_binder<typename decay<T>::type,
typename ExecutionContext::executor_type>( typename ExecutionContext::executor_type>(

View File

@ -386,9 +386,9 @@ private:
/// Get an iterator to the first element in a buffer sequence. /// Get an iterator to the first element in a buffer sequence.
template <typename MutableBuffer> template <typename MutableBuffer>
inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b, inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b,
typename enable_if< typename constraint<
is_convertible<const MutableBuffer*, const mutable_buffer*>::value is_convertible<const MutableBuffer*, const mutable_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return static_cast<const mutable_buffer*>(detail::addressof(b)); return static_cast<const mutable_buffer*>(detail::addressof(b));
} }
@ -396,9 +396,9 @@ inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b,
/// Get an iterator to the first element in a buffer sequence. /// Get an iterator to the first element in a buffer sequence.
template <typename ConstBuffer> template <typename ConstBuffer>
inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b, inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b,
typename enable_if< typename constraint<
is_convertible<const ConstBuffer*, const const_buffer*>::value is_convertible<const ConstBuffer*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return static_cast<const const_buffer*>(detail::addressof(b)); return static_cast<const const_buffer*>(detail::addressof(b));
} }
@ -408,10 +408,10 @@ inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b,
/// Get an iterator to the first element in a buffer sequence. /// Get an iterator to the first element in a buffer sequence.
template <typename C> template <typename C>
inline auto buffer_sequence_begin(C& c, inline auto buffer_sequence_begin(C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.begin()) >::type = 0) ASIO_NOEXCEPT -> decltype(c.begin())
{ {
return c.begin(); return c.begin();
} }
@ -419,10 +419,10 @@ inline auto buffer_sequence_begin(C& c,
/// Get an iterator to the first element in a buffer sequence. /// Get an iterator to the first element in a buffer sequence.
template <typename C> template <typename C>
inline auto buffer_sequence_begin(const C& c, inline auto buffer_sequence_begin(const C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.begin()) >::type = 0) ASIO_NOEXCEPT -> decltype(c.begin())
{ {
return c.begin(); return c.begin();
} }
@ -431,20 +431,20 @@ inline auto buffer_sequence_begin(const C& c,
template <typename C> template <typename C>
inline typename C::iterator buffer_sequence_begin(C& c, inline typename C::iterator buffer_sequence_begin(C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return c.begin(); return c.begin();
} }
template <typename C> template <typename C>
inline typename C::const_iterator buffer_sequence_begin(const C& c, inline typename C::const_iterator buffer_sequence_begin(const C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return c.begin(); return c.begin();
} }
@ -463,9 +463,9 @@ inline typename C::const_iterator buffer_sequence_begin(const C& c,
/// Get an iterator to one past the end element in a buffer sequence. /// Get an iterator to one past the end element in a buffer sequence.
template <typename MutableBuffer> template <typename MutableBuffer>
inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b, inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b,
typename enable_if< typename constraint<
is_convertible<const MutableBuffer*, const mutable_buffer*>::value is_convertible<const MutableBuffer*, const mutable_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return static_cast<const mutable_buffer*>(detail::addressof(b)) + 1; return static_cast<const mutable_buffer*>(detail::addressof(b)) + 1;
} }
@ -473,9 +473,9 @@ inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b,
/// Get an iterator to one past the end element in a buffer sequence. /// Get an iterator to one past the end element in a buffer sequence.
template <typename ConstBuffer> template <typename ConstBuffer>
inline const const_buffer* buffer_sequence_end(const ConstBuffer& b, inline const const_buffer* buffer_sequence_end(const ConstBuffer& b,
typename enable_if< typename constraint<
is_convertible<const ConstBuffer*, const const_buffer*>::value is_convertible<const ConstBuffer*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return static_cast<const const_buffer*>(detail::addressof(b)) + 1; return static_cast<const const_buffer*>(detail::addressof(b)) + 1;
} }
@ -485,10 +485,10 @@ inline const const_buffer* buffer_sequence_end(const ConstBuffer& b,
/// Get an iterator to one past the end element in a buffer sequence. /// Get an iterator to one past the end element in a buffer sequence.
template <typename C> template <typename C>
inline auto buffer_sequence_end(C& c, inline auto buffer_sequence_end(C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.end()) >::type = 0) ASIO_NOEXCEPT -> decltype(c.end())
{ {
return c.end(); return c.end();
} }
@ -496,10 +496,10 @@ inline auto buffer_sequence_end(C& c,
/// Get an iterator to one past the end element in a buffer sequence. /// Get an iterator to one past the end element in a buffer sequence.
template <typename C> template <typename C>
inline auto buffer_sequence_end(const C& c, inline auto buffer_sequence_end(const C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.end()) >::type = 0) ASIO_NOEXCEPT -> decltype(c.end())
{ {
return c.end(); return c.end();
} }
@ -508,20 +508,20 @@ inline auto buffer_sequence_end(const C& c,
template <typename C> template <typename C>
inline typename C::iterator buffer_sequence_end(C& c, inline typename C::iterator buffer_sequence_end(C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return c.end(); return c.end();
} }
template <typename C> template <typename C>
inline typename C::const_iterator buffer_sequence_end(const C& c, inline typename C::const_iterator buffer_sequence_end(const C& c,
typename enable_if< typename constraint<
!is_convertible<const C*, const mutable_buffer*>::value !is_convertible<const C*, const mutable_buffer*>::value
&& !is_convertible<const C*, const const_buffer*>::value && !is_convertible<const C*, const const_buffer*>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
{ {
return c.end(); return c.end();
} }

View File

@ -105,10 +105,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
co_spawn(const Executor& ex, awaitable<T, AwaitableExecutor> a, co_spawn(const Executor& ex, awaitable<T, AwaitableExecutor> a,
CompletionToken&& token CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if< typename constraint<
(is_executor<Executor>::value || execution::is_executor<Executor>::value) (is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value && is_convertible<Executor, AwaitableExecutor>::value
>::type* = 0); >::type = 0);
/// Spawn a new coroutined-based thread of execution. /// Spawn a new coroutined-based thread of execution.
/** /**
@ -161,10 +161,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
co_spawn(const Executor& ex, awaitable<void, AwaitableExecutor> a, co_spawn(const Executor& ex, awaitable<void, AwaitableExecutor> a,
CompletionToken&& token CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if< typename constraint<
(is_executor<Executor>::value || execution::is_executor<Executor>::value) (is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value && is_convertible<Executor, AwaitableExecutor>::value
>::type* = 0); >::type = 0);
/// Spawn a new coroutined-based thread of execution. /// Spawn a new coroutined-based thread of execution.
/** /**
@ -227,11 +227,11 @@ co_spawn(ExecutionContext& ctx, awaitable<T, AwaitableExecutor> a,
CompletionToken&& token CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type), typename ExecutionContext::executor_type),
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type, && is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value AwaitableExecutor>::value
>::type* = 0); >::type = 0);
/// Spawn a new coroutined-based thread of execution. /// Spawn a new coroutined-based thread of execution.
/** /**
@ -286,11 +286,11 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
CompletionToken&& token CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type), typename ExecutionContext::executor_type),
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type, && is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value AwaitableExecutor>::value
>::type* = 0); >::type = 0);
/// Spawn a new coroutined-based thread of execution. /// Spawn a new coroutined-based thread of execution.
/** /**
@ -371,9 +371,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
co_spawn(const Executor& ex, F&& f, co_spawn(const Executor& ex, F&& f,
CompletionToken&& token CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0); >::type = 0);
/// Spawn a new coroutined-based thread of execution. /// Spawn a new coroutined-based thread of execution.
/** /**
@ -456,9 +456,9 @@ co_spawn(ExecutionContext& ctx, F&& f,
CompletionToken&& token CompletionToken&& token
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type), typename ExecutionContext::executor_type),
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0); >::type = 0);
} // namespace asio } // namespace asio

View File

@ -90,8 +90,8 @@ struct is_endpoint_sequence
template <typename Protocol, typename Executor, typename EndpointSequence> template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, const EndpointSequence& endpoints,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type* = 0); EndpointSequence>::value>::type = 0);
/// Establishes a socket connection by trying each endpoint in a sequence. /// Establishes a socket connection by trying each endpoint in a sequence.
/** /**
@ -126,8 +126,8 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename EndpointSequence> template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, asio::error_code& ec, const EndpointSequence& endpoints, asio::error_code& ec,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type* = 0); EndpointSequence>::value>::type = 0);
#if !defined(ASIO_NO_DEPRECATED) #if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Establishes a socket connection by trying /// (Deprecated: Use range overload.) Establishes a socket connection by trying
@ -156,7 +156,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
*/ */
template <typename Protocol, typename Executor, typename Iterator> template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type* = 0); typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
/// (Deprecated: Use range overload.) Establishes a socket connection by trying /// (Deprecated: Use range overload.) Establishes a socket connection by trying
/// each endpoint in a sequence. /// each endpoint in a sequence.
@ -185,7 +185,7 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator> template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, asio::error_code& ec, Iterator begin, asio::error_code& ec,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type* = 0); typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
#endif // !defined(ASIO_NO_DEPRECATED) #endif // !defined(ASIO_NO_DEPRECATED)
/// Establishes a socket connection by trying each endpoint in a sequence. /// Establishes a socket connection by trying each endpoint in a sequence.
@ -311,8 +311,8 @@ template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition> typename EndpointSequence, typename ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition, const EndpointSequence& endpoints, ConnectCondition connect_condition,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type* = 0); EndpointSequence>::value>::type = 0);
/// Establishes a socket connection by trying each endpoint in a sequence. /// Establishes a socket connection by trying each endpoint in a sequence.
/** /**
@ -379,8 +379,8 @@ template <typename Protocol, typename Executor,
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition, const EndpointSequence& endpoints, ConnectCondition connect_condition,
asio::error_code& ec, asio::error_code& ec,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type* = 0); EndpointSequence>::value>::type = 0);
#if !defined(ASIO_NO_DEPRECATED) #if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Establishes a socket connection by trying /// (Deprecated: Use range overload.) Establishes a socket connection by trying
@ -422,7 +422,7 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition> typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition, Iterator begin, ConnectCondition connect_condition,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type* = 0); typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
/// (Deprecated: Use range overload.) Establishes a socket connection by trying /// (Deprecated: Use range overload.) Establishes a socket connection by trying
/// each endpoint in a sequence. /// each endpoint in a sequence.
@ -463,7 +463,7 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition> typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ConnectCondition connect_condition, asio::error_code& ec, ConnectCondition connect_condition, asio::error_code& ec,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type* = 0); typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
#endif // !defined(ASIO_NO_DEPRECATED) #endif // !defined(ASIO_NO_DEPRECATED)
/// Establishes a socket connection by trying each endpoint in a sequence. /// Establishes a socket connection by trying each endpoint in a sequence.
@ -675,8 +675,8 @@ async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, const EndpointSequence& endpoints,
ASIO_MOVE_ARG(RangeConnectHandler) handler ASIO_MOVE_ARG(RangeConnectHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type* = 0); EndpointSequence>::value>::type = 0);
#if !defined(ASIO_NO_DEPRECATED) #if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Asynchronously establishes a socket /// (Deprecated: Use range overload.) Asynchronously establishes a socket
@ -723,7 +723,7 @@ ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ASIO_MOVE_ARG(IteratorConnectHandler) handler ASIO_MOVE_ARG(IteratorConnectHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type* = 0); typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
#endif // !defined(ASIO_NO_DEPRECATED) #endif // !defined(ASIO_NO_DEPRECATED)
/// Asynchronously establishes a socket connection by trying each endpoint in a /// Asynchronously establishes a socket connection by trying each endpoint in a
@ -891,8 +891,8 @@ async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition, const EndpointSequence& endpoints, ConnectCondition connect_condition,
ASIO_MOVE_ARG(RangeConnectHandler) handler ASIO_MOVE_ARG(RangeConnectHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type* = 0); EndpointSequence>::value>::type = 0);
#if !defined(ASIO_NO_DEPRECATED) #if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated: Use range overload.) Asynchronously establishes a socket /// (Deprecated: Use range overload.) Asynchronously establishes a socket
@ -952,7 +952,7 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ConnectCondition connect_condition, ConnectCondition connect_condition,
ASIO_MOVE_ARG(IteratorConnectHandler) handler ASIO_MOVE_ARG(IteratorConnectHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type* = 0); typename constraint<!is_endpoint_sequence<Iterator>::value>::type = 0);
#endif // !defined(ASIO_NO_DEPRECATED) #endif // !defined(ASIO_NO_DEPRECATED)
/// Asynchronously establishes a socket connection by trying each endpoint in a /// Asynchronously establishes a socket connection by trying each endpoint in a

View File

@ -101,9 +101,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
const Executor& ex, const Executor& ex,
ASIO_MOVE_ARG(CompletionToken) token ASIO_MOVE_ARG(CompletionToken) token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if< typename constraint<
execution::is_executor<Executor>::value || is_executor<Executor>::value execution::is_executor<Executor>::value || is_executor<Executor>::value
>::type* = 0); >::type = 0);
/// Submits a completion token or function object for execution. /// Submits a completion token or function object for execution.
/** /**
@ -118,8 +118,8 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
ASIO_MOVE_ARG(CompletionToken) token ASIO_MOVE_ARG(CompletionToken) token
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type), typename ExecutionContext::executor_type),
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type* = 0); ExecutionContext&, execution_context&>::value>::type = 0);
} // namespace asio } // namespace asio

View File

@ -61,9 +61,9 @@ public:
/// that to construct the adapted executor. /// that to construct the adapted executor.
template <typename OtherExecutor> template <typename OtherExecutor>
executor_with_default(const OtherExecutor& ex, executor_with_default(const OtherExecutor& ex,
typename enable_if< typename constraint<
is_convertible<OtherExecutor, InnerExecutor>::value is_convertible<OtherExecutor, InnerExecutor>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
: InnerExecutor(ex) : InnerExecutor(ex)
{ {
} }

View File

@ -143,6 +143,14 @@ template <typename Head, typename... Tail> struct conjunction<Head, Tail...> :
#endif // defined(ASIO_HAS_VARIADIC_TEMPLATES) #endif // defined(ASIO_HAS_VARIADIC_TEMPLATES)
struct defaulted_constraint
{
ASIO_CONSTEXPR defaulted_constraint() {}
};
template <bool Condition, typename Type = int>
struct constraint : enable_if<Condition, Type> {};
} // namespace asio } // namespace asio
#endif // ASIO_DETAIL_TYPE_TRAITS_HPP #endif // ASIO_DETAIL_TYPE_TRAITS_HPP

View File

@ -91,9 +91,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
const Executor& ex, const Executor& ex,
ASIO_MOVE_ARG(CompletionToken) token ASIO_MOVE_ARG(CompletionToken) token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if< typename constraint<
execution::is_executor<Executor>::value || is_executor<Executor>::value execution::is_executor<Executor>::value || is_executor<Executor>::value
>::type* = 0); >::type = 0);
/// Submits a completion token or function object for execution. /// Submits a completion token or function object for execution.
/** /**
@ -109,8 +109,8 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
ASIO_MOVE_ARG(CompletionToken) token ASIO_MOVE_ARG(CompletionToken) token
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type), typename ExecutionContext::executor_type),
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type* = 0); ExecutionContext&, execution_context&>::value>::type = 0);
} // namespace asio } // namespace asio

View File

@ -220,9 +220,9 @@ private:
/// Create an @ref executor_work_guard object. /// Create an @ref executor_work_guard object.
template <typename Executor> template <typename Executor>
inline executor_work_guard<Executor> make_work_guard(const Executor& ex, inline executor_work_guard<Executor> make_work_guard(const Executor& ex,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0) >::type = 0)
{ {
return executor_work_guard<Executor>(ex); return executor_work_guard<Executor>(ex);
} }
@ -231,9 +231,9 @@ inline executor_work_guard<Executor> make_work_guard(const Executor& ex,
template <typename ExecutionContext> template <typename ExecutionContext>
inline executor_work_guard<typename ExecutionContext::executor_type> inline executor_work_guard<typename ExecutionContext::executor_type>
make_work_guard(ExecutionContext& ctx, make_work_guard(ExecutionContext& ctx,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
return executor_work_guard<typename ExecutionContext::executor_type>( return executor_work_guard<typename ExecutionContext::executor_type>(
ctx.get_executor()); ctx.get_executor());
@ -243,15 +243,15 @@ make_work_guard(ExecutionContext& ctx,
template <typename T> template <typename T>
inline executor_work_guard<typename associated_executor<T>::type> inline executor_work_guard<typename associated_executor<T>::type>
make_work_guard(const T& t, make_work_guard(const T& t,
typename enable_if< typename constraint<
!is_executor<T>::value !is_executor<T>::value
>::type* = 0, >::type = 0,
typename enable_if< typename constraint<
!execution::is_executor<T>::value !execution::is_executor<T>::value
>::type* = 0, >::type = 0,
typename enable_if< typename constraint<
!is_convertible<T&, execution_context&>::value !is_convertible<T&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
return executor_work_guard<typename associated_executor<T>::type>( return executor_work_guard<typename associated_executor<T>::type>(
associated_executor<T>::get(t)); associated_executor<T>::get(t));
@ -261,9 +261,9 @@ make_work_guard(const T& t,
template <typename T, typename Executor> template <typename T, typename Executor>
inline executor_work_guard<typename associated_executor<T, Executor>::type> inline executor_work_guard<typename associated_executor<T, Executor>::type>
make_work_guard(const T& t, const Executor& ex, make_work_guard(const T& t, const Executor& ex,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0) >::type = 0)
{ {
return executor_work_guard<typename associated_executor<T, Executor>::type>( return executor_work_guard<typename associated_executor<T, Executor>::type>(
associated_executor<T, Executor>::get(t, ex)); associated_executor<T, Executor>::get(t, ex));
@ -274,18 +274,18 @@ template <typename T, typename ExecutionContext>
inline executor_work_guard<typename associated_executor<T, inline executor_work_guard<typename associated_executor<T,
typename ExecutionContext::executor_type>::type> typename ExecutionContext::executor_type>::type>
make_work_guard(const T& t, ExecutionContext& ctx, make_work_guard(const T& t, ExecutionContext& ctx,
typename enable_if< typename constraint<
!is_executor<T>::value !is_executor<T>::value
>::type* = 0, >::type = 0,
typename enable_if< typename constraint<
!execution::is_executor<T>::value !execution::is_executor<T>::value
>::type* = 0, >::type = 0,
typename enable_if< typename constraint<
!is_convertible<T&, execution_context&>::value !is_convertible<T&, execution_context&>::value
>::type* = 0, >::type = 0,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
return executor_work_guard<typename associated_executor<T, return executor_work_guard<typename associated_executor<T,
typename ExecutionContext::executor_type>::type>( typename ExecutionContext::executor_type>::type>(

View File

@ -80,9 +80,9 @@ public:
/// that to construct the adapted executor. /// that to construct the adapted executor.
template <typename OtherExecutor> template <typename OtherExecutor>
executor_with_default(const OtherExecutor& ex, executor_with_default(const OtherExecutor& ex,
typename enable_if< typename constraint<
is_convertible<OtherExecutor, InnerExecutor>::value is_convertible<OtherExecutor, InnerExecutor>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
: InnerExecutor(ex) : InnerExecutor(ex)
{ {
} }

View File

@ -198,10 +198,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr, T)) CompletionToken, void(std::exception_ptr, T))
co_spawn(const Executor& ex, co_spawn(const Executor& ex,
awaitable<T, AwaitableExecutor> a, CompletionToken&& token, awaitable<T, AwaitableExecutor> a, CompletionToken&& token,
typename enable_if< typename constraint<
(is_executor<Executor>::value || execution::is_executor<Executor>::value) (is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value && is_convertible<Executor, AwaitableExecutor>::value
>::type*) >::type)
{ {
return async_initiate<CompletionToken, void(std::exception_ptr, T)>( return async_initiate<CompletionToken, void(std::exception_ptr, T)>(
detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)), detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)),
@ -215,10 +215,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr)) CompletionToken, void(std::exception_ptr))
co_spawn(const Executor& ex, co_spawn(const Executor& ex,
awaitable<void, AwaitableExecutor> a, CompletionToken&& token, awaitable<void, AwaitableExecutor> a, CompletionToken&& token,
typename enable_if< typename constraint<
(is_executor<Executor>::value || execution::is_executor<Executor>::value) (is_executor<Executor>::value || execution::is_executor<Executor>::value)
&& is_convertible<Executor, AwaitableExecutor>::value && is_convertible<Executor, AwaitableExecutor>::value
>::type*) >::type)
{ {
return async_initiate<CompletionToken, void(std::exception_ptr)>( return async_initiate<CompletionToken, void(std::exception_ptr)>(
detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)), detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)),
@ -233,11 +233,11 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr, T)) CompletionToken, void(std::exception_ptr, T))
co_spawn(ExecutionContext& ctx, co_spawn(ExecutionContext& ctx,
awaitable<T, AwaitableExecutor> a, CompletionToken&& token, awaitable<T, AwaitableExecutor> a, CompletionToken&& token,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type, && is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value AwaitableExecutor>::value
>::type*) >::type)
{ {
return (co_spawn)(ctx.get_executor(), std::move(a), return (co_spawn)(ctx.get_executor(), std::move(a),
std::forward<CompletionToken>(token)); std::forward<CompletionToken>(token));
@ -250,11 +250,11 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(std::exception_ptr)) CompletionToken, void(std::exception_ptr))
co_spawn(ExecutionContext& ctx, co_spawn(ExecutionContext& ctx,
awaitable<void, AwaitableExecutor> a, CompletionToken&& token, awaitable<void, AwaitableExecutor> a, CompletionToken&& token,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
&& is_convertible<typename ExecutionContext::executor_type, && is_convertible<typename ExecutionContext::executor_type,
AwaitableExecutor>::value AwaitableExecutor>::value
>::type*) >::type)
{ {
return (co_spawn)(ctx.get_executor(), std::move(a), return (co_spawn)(ctx.get_executor(), std::move(a),
std::forward<CompletionToken>(token)); std::forward<CompletionToken>(token));
@ -266,9 +266,9 @@ template <typename Executor, typename F,
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
typename detail::awaitable_signature<typename result_of<F()>::type>::type) typename detail::awaitable_signature<typename result_of<F()>::type>::type)
co_spawn(const Executor& ex, F&& f, CompletionToken&& token, co_spawn(const Executor& ex, F&& f, CompletionToken&& token,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type*) >::type)
{ {
return async_initiate<CompletionToken, return async_initiate<CompletionToken,
typename detail::awaitable_signature<typename result_of<F()>::type>::type>( typename detail::awaitable_signature<typename result_of<F()>::type>::type>(
@ -283,9 +283,9 @@ template <typename ExecutionContext, typename F,
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
typename detail::awaitable_signature<typename result_of<F()>::type>::type) typename detail::awaitable_signature<typename result_of<F()>::type>::type)
co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token, co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type*) >::type)
{ {
return (co_spawn)(ctx.get_executor(), std::forward<F>(f), return (co_spawn)(ctx.get_executor(), std::forward<F>(f),
std::forward<CompletionToken>(token)); std::forward<CompletionToken>(token));

View File

@ -105,8 +105,8 @@ namespace detail
template <typename Protocol, typename Executor, typename EndpointSequence> template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, const EndpointSequence& endpoints,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type*) EndpointSequence>::value>::type)
{ {
asio::error_code ec; asio::error_code ec;
typename Protocol::endpoint result = connect(s, endpoints, ec); typename Protocol::endpoint result = connect(s, endpoints, ec);
@ -117,8 +117,8 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
template <typename Protocol, typename Executor, typename EndpointSequence> template <typename Protocol, typename Executor, typename EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, asio::error_code& ec, const EndpointSequence& endpoints, asio::error_code& ec,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type*) EndpointSequence>::value>::type)
{ {
return detail::deref_connect_result<Protocol>( return detail::deref_connect_result<Protocol>(
connect(s, endpoints.begin(), endpoints.end(), connect(s, endpoints.begin(), endpoints.end(),
@ -128,7 +128,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
#if !defined(ASIO_NO_DEPRECATED) #if !defined(ASIO_NO_DEPRECATED)
template <typename Protocol, typename Executor, typename Iterator> template <typename Protocol, typename Executor, typename Iterator>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin, Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type*) typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
{ {
asio::error_code ec; asio::error_code ec;
Iterator result = connect(s, begin, ec); Iterator result = connect(s, begin, ec);
@ -139,7 +139,7 @@ Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
template <typename Protocol, typename Executor, typename Iterator> template <typename Protocol, typename Executor, typename Iterator>
inline Iterator connect(basic_socket<Protocol, Executor>& s, inline Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, asio::error_code& ec, Iterator begin, asio::error_code& ec,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type*) typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
{ {
return connect(s, begin, Iterator(), detail::default_connect_condition(), ec); return connect(s, begin, Iterator(), detail::default_connect_condition(), ec);
} }
@ -166,8 +166,8 @@ template <typename Protocol, typename Executor,
typename EndpointSequence, typename ConnectCondition> typename EndpointSequence, typename ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition, const EndpointSequence& endpoints, ConnectCondition connect_condition,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type*) EndpointSequence>::value>::type)
{ {
asio::error_code ec; asio::error_code ec;
typename Protocol::endpoint result = connect( typename Protocol::endpoint result = connect(
@ -181,8 +181,8 @@ template <typename Protocol, typename Executor,
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s, typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition, const EndpointSequence& endpoints, ConnectCondition connect_condition,
asio::error_code& ec, asio::error_code& ec,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type*) EndpointSequence>::value>::type)
{ {
return detail::deref_connect_result<Protocol>( return detail::deref_connect_result<Protocol>(
connect(s, endpoints.begin(), endpoints.end(), connect(s, endpoints.begin(), endpoints.end(),
@ -194,7 +194,7 @@ template <typename Protocol, typename Executor,
typename Iterator, typename ConnectCondition> typename Iterator, typename ConnectCondition>
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition, Iterator begin, ConnectCondition connect_condition,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type*) typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
{ {
asio::error_code ec; asio::error_code ec;
Iterator result = connect(s, begin, connect_condition, ec); Iterator result = connect(s, begin, connect_condition, ec);
@ -207,7 +207,7 @@ template <typename Protocol, typename Executor,
inline Iterator connect(basic_socket<Protocol, Executor>& s, inline Iterator connect(basic_socket<Protocol, Executor>& s,
Iterator begin, ConnectCondition connect_condition, Iterator begin, ConnectCondition connect_condition,
asio::error_code& ec, asio::error_code& ec,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type*) typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
{ {
return connect(s, begin, Iterator(), connect_condition, ec); return connect(s, begin, Iterator(), connect_condition, ec);
} }
@ -816,8 +816,8 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
async_connect(basic_socket<Protocol, Executor>& s, async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, const EndpointSequence& endpoints,
ASIO_MOVE_ARG(RangeConnectHandler) handler, ASIO_MOVE_ARG(RangeConnectHandler) handler,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type*) EndpointSequence>::value>::type)
{ {
return async_initiate<RangeConnectHandler, return async_initiate<RangeConnectHandler,
void (asio::error_code, typename Protocol::endpoint)>( void (asio::error_code, typename Protocol::endpoint)>(
@ -833,7 +833,7 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
void (asio::error_code, Iterator)) void (asio::error_code, Iterator))
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ASIO_MOVE_ARG(IteratorConnectHandler) handler, ASIO_MOVE_ARG(IteratorConnectHandler) handler,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type*) typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
{ {
return async_initiate<IteratorConnectHandler, return async_initiate<IteratorConnectHandler,
void (asio::error_code, Iterator)>( void (asio::error_code, Iterator)>(
@ -865,8 +865,8 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
async_connect(basic_socket<Protocol, Executor>& s, async_connect(basic_socket<Protocol, Executor>& s,
const EndpointSequence& endpoints, ConnectCondition connect_condition, const EndpointSequence& endpoints, ConnectCondition connect_condition,
ASIO_MOVE_ARG(RangeConnectHandler) handler, ASIO_MOVE_ARG(RangeConnectHandler) handler,
typename enable_if<is_endpoint_sequence< typename constraint<is_endpoint_sequence<
EndpointSequence>::value>::type*) EndpointSequence>::value>::type)
{ {
return async_initiate<RangeConnectHandler, return async_initiate<RangeConnectHandler,
void (asio::error_code, typename Protocol::endpoint)>( void (asio::error_code, typename Protocol::endpoint)>(
@ -884,7 +884,7 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin, async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
ConnectCondition connect_condition, ConnectCondition connect_condition,
ASIO_MOVE_ARG(IteratorConnectHandler) handler, ASIO_MOVE_ARG(IteratorConnectHandler) handler,
typename enable_if<!is_endpoint_sequence<Iterator>::value>::type*) typename constraint<!is_endpoint_sequence<Iterator>::value>::type)
{ {
return async_initiate<IteratorConnectHandler, return async_initiate<IteratorConnectHandler,
void (asio::error_code, Iterator)>( void (asio::error_code, Iterator)>(

View File

@ -224,9 +224,9 @@ template <typename Executor,
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken> ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer( ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
typename enable_if< typename constraint<
execution::is_executor<Executor>::value || is_executor<Executor>::value execution::is_executor<Executor>::value || is_executor<Executor>::value
>::type*) >::type)
{ {
return async_initiate<CompletionToken, void()>( return async_initiate<CompletionToken, void()>(
detail::initiate_defer_with_executor<Executor>(ex), token); detail::initiate_defer_with_executor<Executor>(ex), token);
@ -236,8 +236,8 @@ template <typename ExecutionContext,
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken> ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer( inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type*) ExecutionContext&, execution_context&>::value>::type)
{ {
return async_initiate<CompletionToken, void()>( return async_initiate<CompletionToken, void()>(
detail::initiate_defer_with_executor< detail::initiate_defer_with_executor<

View File

@ -219,9 +219,9 @@ template <typename Executor,
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken> ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch( ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
typename enable_if< typename constraint<
execution::is_executor<Executor>::value || is_executor<Executor>::value execution::is_executor<Executor>::value || is_executor<Executor>::value
>::type*) >::type)
{ {
return async_initiate<CompletionToken, void()>( return async_initiate<CompletionToken, void()>(
detail::initiate_dispatch_with_executor<Executor>(ex), token); detail::initiate_dispatch_with_executor<Executor>(ex), token);
@ -231,8 +231,8 @@ template <typename ExecutionContext,
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken> ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch( inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type*) ExecutionContext&, execution_context&>::value>::type)
{ {
return async_initiate<CompletionToken, void()>( return async_initiate<CompletionToken, void()>(
detail::initiate_dispatch_with_executor< detail::initiate_dispatch_with_executor<

View File

@ -224,9 +224,9 @@ template <typename Executor,
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken> ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post( ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token, const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
typename enable_if< typename constraint<
execution::is_executor<Executor>::value || is_executor<Executor>::value execution::is_executor<Executor>::value || is_executor<Executor>::value
>::type*) >::type)
{ {
return async_initiate<CompletionToken, void()>( return async_initiate<CompletionToken, void()>(
detail::initiate_post_with_executor<Executor>(ex), token); detail::initiate_post_with_executor<Executor>(ex), token);
@ -236,8 +236,8 @@ template <typename ExecutionContext,
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken> ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post( inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token, ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type*) ExecutionContext&, execution_context&>::value>::type)
{ {
return async_initiate<CompletionToken, void()>( return async_initiate<CompletionToken, void()>(
detail::initiate_post_with_executor< detail::initiate_post_with_executor<

View File

@ -65,9 +65,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition> typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type*) >::type)
{ {
return detail::read_buffer_sequence(s, buffers, return detail::read_buffer_sequence(s, buffers,
asio::buffer_sequence_begin(buffers), asio::buffer_sequence_begin(buffers),
@ -76,9 +76,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename MutableBufferSequence> template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec); std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
@ -89,9 +89,9 @@ inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename MutableBufferSequence> template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type*) >::type)
{ {
return read(s, buffers, transfer_all(), ec); return read(s, buffers, transfer_all(), ec);
} }
@ -100,9 +100,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition> typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read(s, buffers, std::size_t bytes_transferred = read(s, buffers,
@ -118,10 +118,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
std::size_t read(SyncReadStream& s, std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
typename decay<DynamicBuffer_v1>::type b( typename decay<DynamicBuffer_v1>::type b(
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers)); ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
@ -150,10 +150,10 @@ std::size_t read(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v1> template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s, inline std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read(s, std::size_t bytes_transferred = read(s,
@ -166,10 +166,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s, inline std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return read(s, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), return read(s, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
transfer_all(), ec); transfer_all(), ec);
@ -180,10 +180,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
inline std::size_t read(SyncReadStream& s, inline std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read(s, std::size_t bytes_transferred = read(s,
@ -239,9 +239,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
DynamicBuffer_v2& b = buffers; DynamicBuffer_v2& b = buffers;
@ -271,9 +271,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read(s, std::size_t bytes_transferred = read(s,
@ -285,9 +285,9 @@ inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return read(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), return read(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
transfer_all(), ec); transfer_all(), ec);
@ -297,9 +297,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read(s, std::size_t bytes_transferred = read(s,
@ -564,9 +564,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -581,9 +581,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers, async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -844,10 +844,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read(AsyncReadStream& s, async_read(AsyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_read(s, return async_read(s,
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
@ -864,10 +864,10 @@ async_read(AsyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -1166,9 +1166,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers, async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_read(s, return async_read(s,
ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
@ -1184,9 +1184,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers, async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(

View File

@ -77,10 +77,10 @@ namespace detail
template <typename SyncReadStream, typename DynamicBuffer_v1> template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -93,10 +93,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
char delim, asio::error_code& ec, char delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
typename decay<DynamicBuffer_v1>::type b( typename decay<DynamicBuffer_v1>::type b(
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers)); ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
@ -147,10 +147,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_STRING_VIEW_PARAM delim, ASIO_STRING_VIEW_PARAM delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -163,10 +163,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec, ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
typename decay<DynamicBuffer_v1>::type b( typename decay<DynamicBuffer_v1>::type b(
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers)); ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
@ -229,10 +229,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
const boost::regex& expr, const boost::regex& expr,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -245,10 +245,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
const boost::regex& expr, asio::error_code& ec, const boost::regex& expr, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
typename decay<DynamicBuffer_v1>::type b( typename decay<DynamicBuffer_v1>::type b(
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers)); ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
@ -313,11 +313,11 @@ template <typename SyncReadStream,
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
MatchCondition match_condition, MatchCondition match_condition,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value && is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -332,11 +332,11 @@ template <typename SyncReadStream,
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
MatchCondition match_condition, asio::error_code& ec, MatchCondition match_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value && is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
typename decay<DynamicBuffer_v1>::type b( typename decay<DynamicBuffer_v1>::type b(
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers)); ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
@ -443,7 +443,7 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename Allocator, typename MatchCondition> template <typename SyncReadStream, typename Allocator, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b, MatchCondition match_condition, asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
typename enable_if<is_match_condition<MatchCondition>::value>::type*) typename constraint<is_match_condition<MatchCondition>::value>::type)
{ {
return read_until(s, basic_streambuf_ref<Allocator>(b), match_condition); return read_until(s, basic_streambuf_ref<Allocator>(b), match_condition);
} }
@ -452,7 +452,7 @@ template <typename SyncReadStream, typename Allocator, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b, asio::basic_streambuf<Allocator>& b,
MatchCondition match_condition, asio::error_code& ec, MatchCondition match_condition, asio::error_code& ec,
typename enable_if<is_match_condition<MatchCondition>::value>::type*) typename constraint<is_match_condition<MatchCondition>::value>::type)
{ {
return read_until(s, basic_streambuf_ref<Allocator>(b), match_condition, ec); return read_until(s, basic_streambuf_ref<Allocator>(b), match_condition, ec);
} }
@ -464,9 +464,9 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, char delim, DynamicBuffer_v2 buffers, char delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -478,9 +478,9 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
char delim, asio::error_code& ec, char delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
DynamicBuffer_v2& b = buffers; DynamicBuffer_v2& b = buffers;
@ -533,9 +533,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim, DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -547,9 +547,9 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec, ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
DynamicBuffer_v2& b = buffers; DynamicBuffer_v2& b = buffers;
@ -614,9 +614,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, const boost::regex& expr, DynamicBuffer_v2 buffers, const boost::regex& expr,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -628,9 +628,9 @@ inline std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
const boost::regex& expr, asio::error_code& ec, const boost::regex& expr, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
DynamicBuffer_v2& b = buffers; DynamicBuffer_v2& b = buffers;
@ -697,10 +697,10 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition> typename DynamicBuffer_v2, typename MatchCondition>
inline std::size_t read_until(SyncReadStream& s, inline std::size_t read_until(SyncReadStream& s,
DynamicBuffer_v2 buffers, MatchCondition match_condition, DynamicBuffer_v2 buffers, MatchCondition match_condition,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value && is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = read_until(s, std::size_t bytes_transferred = read_until(s,
@ -714,10 +714,10 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition> typename DynamicBuffer_v2, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition, asio::error_code& ec, MatchCondition match_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value && is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
DynamicBuffer_v2& b = buffers; DynamicBuffer_v2& b = buffers;
@ -1061,10 +1061,10 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read_until(AsyncReadStream& s, async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
char delim, ASIO_MOVE_ARG(ReadHandler) handler, char delim, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -1369,10 +1369,10 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_STRING_VIEW_PARAM delim, ASIO_STRING_VIEW_PARAM delim,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -1683,10 +1683,10 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
const boost::regex& expr, const boost::regex& expr,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -1995,11 +1995,11 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read_until(AsyncReadStream& s, async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value && is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -2061,7 +2061,7 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read_until(AsyncReadStream& s, async_read_until(AsyncReadStream& s,
asio::basic_streambuf<Allocator>& b, asio::basic_streambuf<Allocator>& b,
MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if<is_match_condition<MatchCondition>::value>::type*) typename constraint<is_match_condition<MatchCondition>::value>::type)
{ {
return async_read_until(s, basic_streambuf_ref<Allocator>(b), return async_read_until(s, basic_streambuf_ref<Allocator>(b),
match_condition, ASIO_MOVE_CAST(ReadHandler)(handler)); match_condition, ASIO_MOVE_CAST(ReadHandler)(handler));
@ -2362,9 +2362,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
char delim, ASIO_MOVE_ARG(ReadHandler) handler, char delim, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -2677,9 +2677,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
async_read_until(AsyncReadStream& s, async_read_until(AsyncReadStream& s,
DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim, DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim,
ASIO_MOVE_ARG(ReadHandler) handler, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -2997,9 +2997,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
const boost::regex& expr, ASIO_MOVE_ARG(ReadHandler) handler, const boost::regex& expr, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -3315,10 +3315,10 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler, MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value && is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_initiate<ReadHandler, return async_initiate<ReadHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(

View File

@ -434,10 +434,10 @@ template <typename Handler, typename Function>
void spawn(ASIO_MOVE_ARG(Handler) handler, void spawn(ASIO_MOVE_ARG(Handler) handler,
ASIO_MOVE_ARG(Function) function, ASIO_MOVE_ARG(Function) function,
const boost::coroutines::attributes& attributes, const boost::coroutines::attributes& attributes,
typename enable_if< typename constraint<
!is_executor<typename decay<Handler>::type>::value && !is_executor<typename decay<Handler>::type>::value &&
!execution::is_executor<typename decay<Handler>::type>::value && !execution::is_executor<typename decay<Handler>::type>::value &&
!is_convertible<Handler&, execution_context&>::value>::type*) !is_convertible<Handler&, execution_context&>::value>::type)
{ {
typedef typename decay<Handler>::type handler_type; typedef typename decay<Handler>::type handler_type;
typedef typename decay<Function>::type function_type; typedef typename decay<Function>::type function_type;
@ -475,9 +475,9 @@ template <typename Function, typename Executor>
inline void spawn(const Executor& ex, inline void spawn(const Executor& ex,
ASIO_MOVE_ARG(Function) function, ASIO_MOVE_ARG(Function) function,
const boost::coroutines::attributes& attributes, const boost::coroutines::attributes& attributes,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type*) >::type)
{ {
asio::spawn(asio::strand<Executor>(ex), asio::spawn(asio::strand<Executor>(ex),
ASIO_MOVE_CAST(Function)(function), attributes); ASIO_MOVE_CAST(Function)(function), attributes);
@ -511,8 +511,8 @@ template <typename Function, typename ExecutionContext>
inline void spawn(ExecutionContext& ctx, inline void spawn(ExecutionContext& ctx,
ASIO_MOVE_ARG(Function) function, ASIO_MOVE_ARG(Function) function,
const boost::coroutines::attributes& attributes, const boost::coroutines::attributes& attributes,
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type*) ExecutionContext&, execution_context&>::value>::type)
{ {
asio::spawn(ctx.get_executor(), asio::spawn(ctx.get_executor(),
ASIO_MOVE_CAST(Function)(function), attributes); ASIO_MOVE_CAST(Function)(function), attributes);

View File

@ -63,9 +63,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition> typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type*) >::type)
{ {
return detail::write_buffer_sequence(s, buffers, return detail::write_buffer_sequence(s, buffers,
asio::buffer_sequence_begin(buffers), asio::buffer_sequence_begin(buffers),
@ -74,9 +74,9 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename ConstBufferSequence> template <typename SyncWriteStream, typename ConstBufferSequence>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = write(s, buffers, transfer_all(), ec); std::size_t bytes_transferred = write(s, buffers, transfer_all(), ec);
@ -87,9 +87,9 @@ inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename ConstBufferSequence> template <typename SyncWriteStream, typename ConstBufferSequence>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type*) >::type)
{ {
return write(s, buffers, transfer_all(), ec); return write(s, buffers, transfer_all(), ec);
} }
@ -98,9 +98,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition> typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = write(s, buffers, std::size_t bytes_transferred = write(s, buffers,
@ -116,10 +116,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
std::size_t write(SyncWriteStream& s, std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
typename decay<DynamicBuffer_v1>::type b( typename decay<DynamicBuffer_v1>::type b(
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers)); ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
@ -133,10 +133,10 @@ std::size_t write(SyncWriteStream& s,
template <typename SyncWriteStream, typename DynamicBuffer_v1> template <typename SyncWriteStream, typename DynamicBuffer_v1>
inline std::size_t write(SyncWriteStream& s, inline std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = write(s, std::size_t bytes_transferred = write(s,
@ -150,10 +150,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1>
inline std::size_t write(SyncWriteStream& s, inline std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return write(s, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), return write(s, ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
transfer_all(), ec); transfer_all(), ec);
@ -164,10 +164,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
inline std::size_t write(SyncWriteStream& s, inline std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = write(s, std::size_t bytes_transferred = write(s,
@ -223,9 +223,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
std::size_t bytes_transferred = write(s, buffers.data(0, buffers.size()), std::size_t bytes_transferred = write(s, buffers.data(0, buffers.size()),
ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec); ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
@ -235,9 +235,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v2> template <typename SyncWriteStream, typename DynamicBuffer_v2>
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = write(s, std::size_t bytes_transferred = write(s,
@ -250,9 +250,9 @@ inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v2> template <typename SyncWriteStream, typename DynamicBuffer_v2>
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return write(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), return write(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
transfer_all(), ec); transfer_all(), ec);
@ -262,9 +262,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
asio::error_code ec; asio::error_code ec;
std::size_t bytes_transferred = write(s, std::size_t bytes_transferred = write(s,
@ -529,9 +529,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type*) >::type)
{ {
return async_initiate<WriteHandler, return async_initiate<WriteHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -547,9 +547,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type*) >::type)
{ {
return async_initiate<WriteHandler, return async_initiate<WriteHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -780,10 +780,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
async_write(AsyncWriteStream& s, async_write(AsyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_write(s, return async_write(s,
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
@ -800,10 +800,10 @@ async_write(AsyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type*) >::type)
{ {
return async_initiate<WriteHandler, return async_initiate<WriteHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(
@ -1068,9 +1068,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
void (asio::error_code, std::size_t)) void (asio::error_code, std::size_t))
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers, async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_write(s, return async_write(s,
ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers), ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
@ -1086,9 +1086,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers, async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type*) >::type)
{ {
return async_initiate<WriteHandler, return async_initiate<WriteHandler,
void (asio::error_code, std::size_t)>( void (asio::error_code, std::size_t)>(

View File

@ -119,9 +119,9 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_resolver(ExecutionContext& context, explicit basic_resolver(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -158,9 +158,9 @@ public:
*/ */
template <typename Executor1> template <typename Executor1>
basic_resolver(basic_resolver<InternetProtocol, Executor1>&& other, basic_resolver(basic_resolver<InternetProtocol, Executor1>&& other,
typename enable_if< typename constraint<
is_convertible<Executor1, Executor>::value is_convertible<Executor1, Executor>::value
>::type* = 0) >::type = 0)
: impl_(std::move(other.impl_)) : impl_(std::move(other.impl_))
{ {
} }
@ -196,7 +196,7 @@ public:
* constructed using the @c basic_resolver(const executor_type&) constructor. * constructed using the @c basic_resolver(const executor_type&) constructor.
*/ */
template <typename Executor1> template <typename Executor1>
typename enable_if< typename constraint<
is_convertible<Executor1, Executor>::value, is_convertible<Executor1, Executor>::value,
basic_resolver& basic_resolver&
>::type operator=(basic_resolver<InternetProtocol, Executor1>&& other) >::type operator=(basic_resolver<InternetProtocol, Executor1>&& other)

View File

@ -99,9 +99,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_descriptor(ExecutionContext& context, explicit basic_descriptor(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -145,9 +146,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_descriptor(ExecutionContext& context, basic_descriptor(ExecutionContext& context,
const native_handle_type& native_descriptor, const native_handle_type& native_descriptor,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;

View File

@ -91,9 +91,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_stream_descriptor(ExecutionContext& context, explicit basic_stream_descriptor(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value,
>::type* = 0) defaulted_constraint
>::type = defaulted_constraint())
: basic_descriptor<Executor>(context) : basic_descriptor<Executor>(context)
{ {
} }
@ -133,9 +134,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_stream_descriptor(ExecutionContext& context, basic_stream_descriptor(ExecutionContext& context,
const native_handle_type& native_descriptor, const native_handle_type& native_descriptor,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_descriptor<Executor>(context, native_descriptor) : basic_descriptor<Executor>(context, native_descriptor)
{ {
} }

View File

@ -97,9 +97,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
const Executor& ex, const Executor& ex,
ASIO_MOVE_ARG(CompletionToken) token ASIO_MOVE_ARG(CompletionToken) token
ASIO_DEFAULT_COMPLETION_TOKEN(Executor), ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if< typename constraint<
execution::is_executor<Executor>::value || is_executor<Executor>::value execution::is_executor<Executor>::value || is_executor<Executor>::value
>::type* = 0); >::type = 0);
/// Submits a completion token or function object for execution. /// Submits a completion token or function object for execution.
/** /**
@ -114,8 +114,8 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
ASIO_MOVE_ARG(CompletionToken) token ASIO_MOVE_ARG(CompletionToken) token
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename ExecutionContext::executor_type), typename ExecutionContext::executor_type),
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type* = 0); ExecutionContext&, execution_context&>::value>::type = 0);
} // namespace asio } // namespace asio

View File

@ -75,9 +75,9 @@ namespace asio {
*/ */
template <typename SyncReadStream, typename MutableBufferSequence> template <typename SyncReadStream, typename MutableBufferSequence>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -118,9 +118,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename MutableBufferSequence> template <typename SyncReadStream, typename MutableBufferSequence>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -172,9 +172,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition> typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -219,9 +219,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition> typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers, std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) #if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@ -255,10 +255,10 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
template <typename SyncReadStream, typename DynamicBuffer_v1> template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read(SyncReadStream& s, std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -290,10 +290,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read(SyncReadStream& s, std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -336,10 +336,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
std::size_t read(SyncReadStream& s, std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -383,10 +383,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
std::size_t read(SyncReadStream& s, std::size_t read(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM) #if !defined(ASIO_NO_IOSTREAM)
@ -564,9 +564,9 @@ std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
*/ */
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -597,9 +597,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -641,9 +641,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Attempt to read a certain amount of data from a stream before returning. /// Attempt to read a certain amount of data from a stream before returning.
/** /**
@ -686,9 +686,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/*@}*/ /*@}*/
/** /**
@ -770,9 +770,9 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to read a certain amount of data from a /// Start an asynchronous operation to read a certain amount of data from a
/// stream. /// stream.
@ -850,9 +850,9 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) #if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@ -918,10 +918,10 @@ async_read(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to read a certain amount of data from a /// Start an asynchronous operation to read a certain amount of data from a
/// stream. /// stream.
@ -995,10 +995,10 @@ async_read(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM) #if !defined(ASIO_NO_IOSTREAM)
@ -1198,9 +1198,9 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to read a certain amount of data from a /// Start an asynchronous operation to read a certain amount of data from a
/// stream. /// stream.
@ -1273,9 +1273,9 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/*@}*/ /*@}*/

View File

@ -133,10 +133,10 @@ struct is_match_condition
template <typename SyncReadStream, typename DynamicBuffer_v1> template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, char delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until it contains a specified /// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter. /// delimiter.
@ -176,10 +176,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
char delim, asio::error_code& ec, char delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until it contains a specified /// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter. /// delimiter.
@ -236,10 +236,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_STRING_VIEW_PARAM delim, ASIO_STRING_VIEW_PARAM delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until it contains a specified /// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter. /// delimiter.
@ -280,10 +280,10 @@ std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
ASIO_STRING_VIEW_PARAM delim, ASIO_STRING_VIEW_PARAM delim,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \ #if defined(ASIO_HAS_BOOST_REGEX) \
@ -347,10 +347,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
const boost::regex& expr, const boost::regex& expr,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until some part of the data it /// Read data into a dynamic buffer sequence until some part of the data it
/// contains matches a regular expression. /// contains matches a regular expression.
@ -392,10 +392,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
const boost::regex& expr, asio::error_code& ec, const boost::regex& expr, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#endif // defined(ASIO_HAS_BOOST_REGEX) #endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION) // || defined(GENERATING_DOCUMENTATION)
@ -507,11 +507,11 @@ template <typename SyncReadStream,
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
MatchCondition match_condition, MatchCondition match_condition,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value && is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until a function object indicates a /// Read data into a dynamic buffer sequence until a function object indicates a
/// match. /// match.
@ -571,11 +571,11 @@ template <typename SyncReadStream,
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
MatchCondition match_condition, asio::error_code& ec, MatchCondition match_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value && is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_IOSTREAM) #if !defined(ASIO_NO_IOSTREAM)
@ -955,7 +955,7 @@ std::size_t read_until(SyncReadStream& s,
template <typename SyncReadStream, typename Allocator, typename MatchCondition> template <typename SyncReadStream, typename Allocator, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b, MatchCondition match_condition, asio::basic_streambuf<Allocator>& b, MatchCondition match_condition,
typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0); typename constraint<is_match_condition<MatchCondition>::value>::type = 0);
/// Read data into a streambuf until a function object indicates a match. /// Read data into a streambuf until a function object indicates a match.
/** /**
@ -1012,7 +1012,7 @@ template <typename SyncReadStream, typename Allocator, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, std::size_t read_until(SyncReadStream& s,
asio::basic_streambuf<Allocator>& b, asio::basic_streambuf<Allocator>& b,
MatchCondition match_condition, asio::error_code& ec, MatchCondition match_condition, asio::error_code& ec,
typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0); typename constraint<is_match_condition<MatchCondition>::value>::type = 0);
#endif // !defined(ASIO_NO_IOSTREAM) #endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS) #endif // !defined(ASIO_NO_EXTENSIONS)
@ -1073,9 +1073,9 @@ std::size_t read_until(SyncReadStream& s,
*/ */
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until it contains a specified /// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter. /// delimiter.
@ -1114,9 +1114,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
char delim, asio::error_code& ec, char delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until it contains a specified /// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter. /// delimiter.
@ -1172,9 +1172,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim, ASIO_STRING_VIEW_PARAM delim,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until it contains a specified /// Read data into a dynamic buffer sequence until it contains a specified
/// delimiter. /// delimiter.
@ -1213,9 +1213,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec, ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \ #if defined(ASIO_HAS_BOOST_REGEX) \
@ -1278,9 +1278,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
const boost::regex& expr, const boost::regex& expr,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until some part of the data it /// Read data into a dynamic buffer sequence until some part of the data it
/// contains matches a regular expression. /// contains matches a regular expression.
@ -1321,9 +1321,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
template <typename SyncReadStream, typename DynamicBuffer_v2> template <typename SyncReadStream, typename DynamicBuffer_v2>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
const boost::regex& expr, asio::error_code& ec, const boost::regex& expr, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
#endif // defined(ASIO_HAS_BOOST_REGEX) #endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION) // || defined(GENERATING_DOCUMENTATION)
@ -1434,10 +1434,10 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition> typename DynamicBuffer_v2, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition, MatchCondition match_condition,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value && is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Read data into a dynamic buffer sequence until a function object indicates a /// Read data into a dynamic buffer sequence until a function object indicates a
/// match. /// match.
@ -1496,10 +1496,10 @@ template <typename SyncReadStream,
typename DynamicBuffer_v2, typename MatchCondition> typename DynamicBuffer_v2, typename MatchCondition>
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
MatchCondition match_condition, asio::error_code& ec, MatchCondition match_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value && is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
#endif // !defined(ASIO_NO_EXTENSIONS) #endif // !defined(ASIO_NO_EXTENSIONS)
@ -1610,10 +1610,10 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to read data into a dynamic buffer sequence /// Start an asynchronous operation to read data into a dynamic buffer sequence
/// until it contains a specified delimiter. /// until it contains a specified delimiter.
@ -1710,10 +1710,10 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \ #if defined(ASIO_HAS_BOOST_REGEX) \
@ -1817,10 +1817,10 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#endif // defined(ASIO_HAS_BOOST_REGEX) #endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION) // || defined(GENERATING_DOCUMENTATION)
@ -1967,11 +1967,11 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value && is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_IOSTREAM) #if !defined(ASIO_NO_IOSTREAM)
@ -2395,7 +2395,7 @@ async_read_until(AsyncReadStream& s,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0); typename constraint<is_match_condition<MatchCondition>::value>::type = 0);
#endif // !defined(ASIO_NO_IOSTREAM) #endif // !defined(ASIO_NO_IOSTREAM)
#endif // !defined(ASIO_NO_EXTENSIONS) #endif // !defined(ASIO_NO_EXTENSIONS)
@ -2494,9 +2494,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to read data into a dynamic buffer sequence /// Start an asynchronous operation to read data into a dynamic buffer sequence
/// until it contains a specified delimiter. /// until it contains a specified delimiter.
@ -2592,9 +2592,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if defined(ASIO_HAS_BOOST_REGEX) \ #if defined(ASIO_HAS_BOOST_REGEX) \
@ -2697,9 +2697,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
#endif // defined(ASIO_HAS_BOOST_REGEX) #endif // defined(ASIO_HAS_BOOST_REGEX)
// || defined(GENERATING_DOCUMENTATION) // || defined(GENERATING_DOCUMENTATION)
@ -2845,10 +2845,10 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(ReadHandler) handler ASIO_MOVE_ARG(ReadHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncReadStream::executor_type), typename AsyncReadStream::executor_type),
typename enable_if< typename constraint<
is_match_condition<MatchCondition>::value is_match_condition<MatchCondition>::value
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value && is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
#endif // !defined(ASIO_NO_EXTENSIONS) #endif // !defined(ASIO_NO_EXTENSIONS)

View File

@ -225,10 +225,10 @@ void spawn(ASIO_MOVE_ARG(Handler) handler,
ASIO_MOVE_ARG(Function) function, ASIO_MOVE_ARG(Function) function,
const boost::coroutines::attributes& attributes const boost::coroutines::attributes& attributes
= boost::coroutines::attributes(), = boost::coroutines::attributes(),
typename enable_if< typename constraint<
!is_executor<typename decay<Handler>::type>::value && !is_executor<typename decay<Handler>::type>::value &&
!execution::is_executor<typename decay<Handler>::type>::value && !execution::is_executor<typename decay<Handler>::type>::value &&
!is_convertible<Handler&, execution_context&>::value>::type* = 0); !is_convertible<Handler&, execution_context&>::value>::type = 0);
/// Start a new stackful coroutine, inheriting the execution context of another. /// Start a new stackful coroutine, inheriting the execution context of another.
/** /**
@ -268,9 +268,9 @@ void spawn(const Executor& ex,
ASIO_MOVE_ARG(Function) function, ASIO_MOVE_ARG(Function) function,
const boost::coroutines::attributes& attributes const boost::coroutines::attributes& attributes
= boost::coroutines::attributes(), = boost::coroutines::attributes(),
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0); >::type = 0);
/// Start a new stackful coroutine that executes on a given strand. /// Start a new stackful coroutine that executes on a given strand.
/** /**
@ -330,8 +330,8 @@ void spawn(ExecutionContext& ctx,
ASIO_MOVE_ARG(Function) function, ASIO_MOVE_ARG(Function) function,
const boost::coroutines::attributes& attributes const boost::coroutines::attributes& attributes
= boost::coroutines::attributes(), = boost::coroutines::attributes(),
typename enable_if<is_convertible< typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type* = 0); ExecutionContext&, execution_context&>::value>::type = 0);
/*@}*/ /*@}*/

View File

@ -47,13 +47,13 @@ public:
/// Construct a strand for the specified executor. /// Construct a strand for the specified executor.
template <typename Executor1> template <typename Executor1>
explicit strand(const Executor1& e, explicit strand(const Executor1& e,
typename enable_if< typename constraint<
conditional< conditional<
!is_same<Executor1, strand>::value, !is_same<Executor1, strand>::value,
is_convertible<Executor1, Executor>, is_convertible<Executor1, Executor>,
false_type false_type
>::type::value >::type::value
>::type* = 0) >::type = 0)
: executor_(e), : executor_(e),
impl_(strand::create_implementation(executor_)) impl_(strand::create_implementation(executor_))
{ {
@ -166,7 +166,7 @@ public:
* ... @endcode * ... @endcode
*/ */
template <typename Property> template <typename Property>
typename enable_if< typename constraint<
can_query<const Executor&, Property>::value, can_query<const Executor&, Property>::value,
typename query_result<const Executor&, Property>::type typename query_result<const Executor&, Property>::type
>::type query(const Property& p) const >::type query(const Property& p) const
@ -187,7 +187,7 @@ public:
* asio::execution::blocking.never); @endcode * asio::execution::blocking.never); @endcode
*/ */
template <typename Property> template <typename Property>
typename enable_if< typename constraint<
can_require<const Executor&, Property>::value, can_require<const Executor&, Property>::value,
strand<typename decay< strand<typename decay<
typename require_result<const Executor&, Property>::type typename require_result<const Executor&, Property>::type
@ -212,7 +212,7 @@ public:
* asio::execution::blocking.never); @endcode * asio::execution::blocking.never); @endcode
*/ */
template <typename Property> template <typename Property>
typename enable_if< typename constraint<
can_prefer<const Executor&, Property>::value, can_prefer<const Executor&, Property>::value,
strand<typename decay< strand<typename decay<
typename prefer_result<const Executor&, Property>::type typename prefer_result<const Executor&, Property>::type
@ -270,8 +270,9 @@ public:
* function object must be: @code void function(); @endcode * function object must be: @code void function(); @endcode
*/ */
template <typename Function> template <typename Function>
typename enable_if< typename constraint<
execution::can_execute<const Executor&, Function>::value execution::can_execute<const Executor&, Function>::value,
void
>::type execute(ASIO_MOVE_ARG(Function) f) const >::type execute(ASIO_MOVE_ARG(Function) f) const
{ {
detail::strand_executor_service::execute(impl_, detail::strand_executor_service::execute(impl_,
@ -381,9 +382,9 @@ private:
template <typename InnerExecutor> template <typename InnerExecutor>
static implementation_type create_implementation(const InnerExecutor& ex, static implementation_type create_implementation(const InnerExecutor& ex,
typename enable_if< typename constraint<
can_query<InnerExecutor, execution::context_t>::value can_query<InnerExecutor, execution::context_t>::value
>::type* = 0) >::type = 0)
{ {
return use_service<detail::strand_executor_service>( return use_service<detail::strand_executor_service>(
asio::query(ex, execution::context)).create_implementation(); asio::query(ex, execution::context)).create_implementation();
@ -391,9 +392,9 @@ private:
template <typename InnerExecutor> template <typename InnerExecutor>
static implementation_type create_implementation(const InnerExecutor& ex, static implementation_type create_implementation(const InnerExecutor& ex,
typename enable_if< typename constraint<
!can_query<InnerExecutor, execution::context_t>::value !can_query<InnerExecutor, execution::context_t>::value
>::type* = 0) >::type = 0)
{ {
return use_service<detail::strand_executor_service>( return use_service<detail::strand_executor_service>(
ex.context()).create_implementation(); ex.context()).create_implementation();
@ -419,9 +420,9 @@ private:
/// Create a @ref strand object for an executor. /// Create a @ref strand object for an executor.
template <typename Executor> template <typename Executor>
inline strand<Executor> make_strand(const Executor& ex, inline strand<Executor> make_strand(const Executor& ex,
typename enable_if< typename constraint<
is_executor<Executor>::value || execution::is_executor<Executor>::value is_executor<Executor>::value || execution::is_executor<Executor>::value
>::type* = 0) >::type = 0)
{ {
return strand<Executor>(ex); return strand<Executor>(ex);
} }
@ -430,9 +431,9 @@ inline strand<Executor> make_strand(const Executor& ex,
template <typename ExecutionContext> template <typename ExecutionContext>
inline strand<typename ExecutionContext::executor_type> inline strand<typename ExecutionContext::executor_type>
make_strand(ExecutionContext& ctx, make_strand(ExecutionContext& ctx,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
return strand<typename ExecutionContext::executor_type>(ctx.get_executor()); return strand<typename ExecutionContext::executor_type>(ctx.get_executor());
} }

View File

@ -108,9 +108,9 @@ struct use_awaitable_t
/// that to construct the adapted executor. /// that to construct the adapted executor.
template <typename OtherExecutor> template <typename OtherExecutor>
executor_with_default(const OtherExecutor& ex, executor_with_default(const OtherExecutor& ex,
typename enable_if< typename constraint<
is_convertible<OtherExecutor, InnerExecutor>::value is_convertible<OtherExecutor, InnerExecutor>::value
>::type* = 0) ASIO_NOEXCEPT >::type = 0) ASIO_NOEXCEPT
: InnerExecutor(ex) : InnerExecutor(ex)
{ {
} }

View File

@ -96,10 +96,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_object_handle(ExecutionContext& context, explicit basic_object_handle(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value, is_convertible<ExecutionContext&, execution_context&>::value,
basic_object_handle defaulted_constraint
>::type* = 0) >::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -142,9 +142,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_object_handle(ExecutionContext& context, basic_object_handle(ExecutionContext& context,
const native_handle_type& native_handle, const native_handle_type& native_handle,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;

View File

@ -99,10 +99,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_overlapped_handle(ExecutionContext& context, explicit basic_overlapped_handle(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value, is_convertible<ExecutionContext&, execution_context&>::value,
basic_overlapped_handle defaulted_constraint
>::type* = 0) >::type = defaulted_constraint())
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
} }
@ -145,9 +145,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_overlapped_handle(ExecutionContext& context, basic_overlapped_handle(ExecutionContext& context,
const native_handle_type& native_handle, const native_handle_type& native_handle,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(0, 0, context) : impl_(0, 0, context)
{ {
asio::error_code ec; asio::error_code ec;

View File

@ -84,10 +84,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_random_access_handle(ExecutionContext& context, explicit basic_random_access_handle(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value, is_convertible<ExecutionContext&, execution_context&>::value,
basic_random_access_handle defaulted_constraint
>::type* = 0) >::type = defaulted_constraint())
: basic_overlapped_handle<Executor>(context) : basic_overlapped_handle<Executor>(context)
{ {
} }
@ -127,9 +127,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_random_access_handle(ExecutionContext& context, basic_random_access_handle(ExecutionContext& context,
const native_handle_type& handle, const native_handle_type& handle,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_overlapped_handle<Executor>(context, handle) : basic_overlapped_handle<Executor>(context, handle)
{ {
} }

View File

@ -86,10 +86,10 @@ public:
*/ */
template <typename ExecutionContext> template <typename ExecutionContext>
explicit basic_stream_handle(ExecutionContext& context, explicit basic_stream_handle(ExecutionContext& context,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value, is_convertible<ExecutionContext&, execution_context&>::value,
basic_stream_handle defaulted_constraint
>::type* = 0) >::type = defaulted_constraint())
: basic_overlapped_handle<Executor>(context) : basic_overlapped_handle<Executor>(context)
{ {
} }
@ -128,9 +128,9 @@ public:
template <typename ExecutionContext> template <typename ExecutionContext>
basic_stream_handle(ExecutionContext& context, basic_stream_handle(ExecutionContext& context,
const native_handle_type& handle, const native_handle_type& handle,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: basic_overlapped_handle<Executor>(context, handle) : basic_overlapped_handle<Executor>(context, handle)
{ {
} }

View File

@ -52,9 +52,9 @@ public:
template <typename ExecutionContext, typename Handler> template <typename ExecutionContext, typename Handler>
explicit overlapped_ptr(ExecutionContext& context, explicit overlapped_ptr(ExecutionContext& context,
ASIO_MOVE_ARG(Handler) handler, ASIO_MOVE_ARG(Handler) handler,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
: impl_(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler)) : impl_(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler))
{ {
} }
@ -63,10 +63,10 @@ public:
template <typename Executor, typename Handler> template <typename Executor, typename Handler>
explicit overlapped_ptr(const Executor& ex, explicit overlapped_ptr(const Executor& ex,
ASIO_MOVE_ARG(Handler) handler, ASIO_MOVE_ARG(Handler) handler,
typename enable_if< typename constraint<
execution::is_executor<Executor>::value execution::is_executor<Executor>::value
|| is_executor<Executor>::value || is_executor<Executor>::value
>::type* = 0) >::type = 0)
: impl_(ex, ASIO_MOVE_CAST(Handler)(handler)) : impl_(ex, ASIO_MOVE_CAST(Handler)(handler))
{ {
} }
@ -86,9 +86,9 @@ public:
/// object. /// object.
template <typename ExecutionContext, typename Handler> template <typename ExecutionContext, typename Handler>
void reset(ExecutionContext& context, ASIO_MOVE_ARG(Handler) handler, void reset(ExecutionContext& context, ASIO_MOVE_ARG(Handler) handler,
typename enable_if< typename constraint<
is_convertible<ExecutionContext&, execution_context&>::value is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0) >::type = 0)
{ {
impl_.reset(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler)); impl_.reset(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler));
} }
@ -97,10 +97,10 @@ public:
/// object. /// object.
template <typename Executor, typename Handler> template <typename Executor, typename Handler>
void reset(const Executor& ex, ASIO_MOVE_ARG(Handler) handler, void reset(const Executor& ex, ASIO_MOVE_ARG(Handler) handler,
typename enable_if< typename constraint<
execution::is_executor<Executor>::value execution::is_executor<Executor>::value
|| is_executor<Executor>::value || is_executor<Executor>::value
>::type* = 0) >::type = 0)
{ {
impl_.reset(ex, ASIO_MOVE_CAST(Handler)(handler)); impl_.reset(ex, ASIO_MOVE_CAST(Handler)(handler));
} }

View File

@ -75,9 +75,9 @@ namespace asio {
*/ */
template <typename SyncWriteStream, typename ConstBufferSequence> template <typename SyncWriteStream, typename ConstBufferSequence>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type* = 0); >::type = 0);
/// Write all of the supplied data to a stream before returning. /// Write all of the supplied data to a stream before returning.
/** /**
@ -118,9 +118,9 @@ std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename ConstBufferSequence> template <typename SyncWriteStream, typename ConstBufferSequence>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type* = 0); >::type = 0);
/// Write a certain amount of data to a stream before returning. /// Write a certain amount of data to a stream before returning.
/** /**
@ -172,9 +172,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition> typename CompletionCondition>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type* = 0); >::type = 0);
/// Write a certain amount of data to a stream before returning. /// Write a certain amount of data to a stream before returning.
/** /**
@ -219,9 +219,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
typename CompletionCondition> typename CompletionCondition>
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers, std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) #if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@ -255,10 +255,10 @@ std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v1> template <typename SyncWriteStream, typename DynamicBuffer_v1>
std::size_t write(SyncWriteStream& s, std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Write all of the supplied data to a stream before returning. /// Write all of the supplied data to a stream before returning.
/** /**
@ -291,10 +291,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1>
std::size_t write(SyncWriteStream& s, std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Write a certain amount of data to a stream before returning. /// Write a certain amount of data to a stream before returning.
/** /**
@ -337,10 +337,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
std::size_t write(SyncWriteStream& s, std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Write a certain amount of data to a stream before returning. /// Write a certain amount of data to a stream before returning.
/** /**
@ -384,10 +384,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
std::size_t write(SyncWriteStream& s, std::size_t write(SyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM) #if !defined(ASIO_NO_IOSTREAM)
@ -565,9 +565,9 @@ std::size_t write(SyncWriteStream& s, basic_streambuf<Allocator>& b,
*/ */
template <typename SyncWriteStream, typename DynamicBuffer_v2> template <typename SyncWriteStream, typename DynamicBuffer_v2>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Write all of the supplied data to a stream before returning. /// Write all of the supplied data to a stream before returning.
/** /**
@ -599,9 +599,9 @@ std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
template <typename SyncWriteStream, typename DynamicBuffer_v2> template <typename SyncWriteStream, typename DynamicBuffer_v2>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
asio::error_code& ec, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Write a certain amount of data to a stream before returning. /// Write a certain amount of data to a stream before returning.
/** /**
@ -643,9 +643,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Write a certain amount of data to a stream before returning. /// Write a certain amount of data to a stream before returning.
/** /**
@ -688,9 +688,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
typename CompletionCondition> typename CompletionCondition>
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers, std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, asio::error_code& ec, CompletionCondition completion_condition, asio::error_code& ec,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/*@}*/ /*@}*/
/** /**
@ -764,9 +764,9 @@ async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
ASIO_MOVE_ARG(WriteHandler) handler ASIO_MOVE_ARG(WriteHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncWriteStream::executor_type), typename AsyncWriteStream::executor_type),
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to write a certain amount of data to a /// Start an asynchronous operation to write a certain amount of data to a
/// stream. /// stream.
@ -844,9 +844,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers, async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_const_buffer_sequence<ConstBufferSequence>::value is_const_buffer_sequence<ConstBufferSequence>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1) #if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
@ -905,10 +905,10 @@ async_write(AsyncWriteStream& s,
ASIO_MOVE_ARG(WriteHandler) handler ASIO_MOVE_ARG(WriteHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncWriteStream::executor_type), typename AsyncWriteStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to write a certain amount of data to a /// Start an asynchronous operation to write a certain amount of data to a
/// stream. /// stream.
@ -977,10 +977,10 @@ async_write(AsyncWriteStream& s,
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers, ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value && !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
>::type* = 0); >::type = 0);
#if !defined(ASIO_NO_EXTENSIONS) #if !defined(ASIO_NO_EXTENSIONS)
#if !defined(ASIO_NO_IOSTREAM) #if !defined(ASIO_NO_IOSTREAM)
@ -1161,9 +1161,9 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
ASIO_MOVE_ARG(WriteHandler) handler ASIO_MOVE_ARG(WriteHandler) handler
ASIO_DEFAULT_COMPLETION_TOKEN( ASIO_DEFAULT_COMPLETION_TOKEN(
typename AsyncWriteStream::executor_type), typename AsyncWriteStream::executor_type),
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/// Start an asynchronous operation to write a certain amount of data to a /// Start an asynchronous operation to write a certain amount of data to a
/// stream. /// stream.
@ -1231,9 +1231,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers, async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
CompletionCondition completion_condition, CompletionCondition completion_condition,
ASIO_MOVE_ARG(WriteHandler) handler, ASIO_MOVE_ARG(WriteHandler) handler,
typename enable_if< typename constraint<
is_dynamic_buffer_v2<DynamicBuffer_v2>::value is_dynamic_buffer_v2<DynamicBuffer_v2>::value
>::type* = 0); >::type = 0);
/*@}*/ /*@}*/