Use constraint<> rather than enable_if<> in public SFINAE-constrained functions.
This commit is contained in:
parent
b5a8065ecc
commit
6c177789f8
@ -119,7 +119,7 @@ public:
|
||||
#else // defined(GENERATING_DOCUMENTATION)
|
||||
template <typename OtherAnyExecutor>
|
||||
any_io_executor(OtherAnyExecutor e,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
conditional<
|
||||
!is_same<OtherAnyExecutor, any_io_executor>::value
|
||||
&& is_base_of<execution::detail::any_executor_base,
|
||||
@ -129,7 +129,7 @@ public:
|
||||
is_valid_target<OtherAnyExecutor>,
|
||||
false_type
|
||||
>::type::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: base_type(ASIO_MOVE_CAST(OtherAnyExecutor)(e))
|
||||
{
|
||||
}
|
||||
@ -142,7 +142,7 @@ public:
|
||||
#else // defined(GENERATING_DOCUMENTATION)
|
||||
template <ASIO_EXECUTION_EXECUTOR Executor>
|
||||
any_io_executor(Executor e,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
conditional<
|
||||
!is_same<Executor, any_io_executor>::value
|
||||
&& !is_base_of<execution::detail::any_executor_base,
|
||||
@ -151,7 +151,7 @@ public:
|
||||
Executor, supportable_properties_type>,
|
||||
false_type
|
||||
>::type::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: base_type(ASIO_MOVE_CAST(Executor)(e))
|
||||
{
|
||||
}
|
||||
@ -202,9 +202,9 @@ public:
|
||||
*/
|
||||
template <typename Property>
|
||||
any_io_executor require(const Property& p,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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);
|
||||
}
|
||||
@ -220,9 +220,9 @@ public:
|
||||
*/
|
||||
template <typename Property>
|
||||
any_io_executor prefer(const Property& p,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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);
|
||||
}
|
||||
|
@ -108,9 +108,9 @@ get_associated_executor(const T& t) ASIO_NOEXCEPT
|
||||
template <typename T, typename Executor>
|
||||
inline typename associated_executor<T, Executor>::type
|
||||
get_associated_executor(const T& t, const Executor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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);
|
||||
}
|
||||
@ -124,8 +124,8 @@ template <typename T, typename ExecutionContext>
|
||||
inline typename associated_executor<T,
|
||||
typename ExecutionContext::executor_type>::type
|
||||
get_associated_executor(const T& t, ExecutionContext& ctx,
|
||||
typename enable_if<is_convertible<ExecutionContext&,
|
||||
execution_context&>::value>::type* = 0) ASIO_NOEXCEPT
|
||||
typename constraint<is_convertible<ExecutionContext&,
|
||||
execution_context&>::value>::type = 0) ASIO_NOEXCEPT
|
||||
{
|
||||
return associated_executor<T,
|
||||
typename ExecutionContext::executor_type>::get(t, ctx.get_executor());
|
||||
|
@ -349,7 +349,7 @@ void_or_deduced async_initiate(
|
||||
template <typename CompletionToken,
|
||||
ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation, typename... Args>
|
||||
inline typename enable_if<
|
||||
inline typename constraint<
|
||||
detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
|
||||
(async_result<typename decay<CompletionToken>::type,
|
||||
@ -369,7 +369,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
template <typename CompletionToken,
|
||||
ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation, typename... Args>
|
||||
inline typename enable_if<
|
||||
inline typename constraint<
|
||||
!detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
|
||||
async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
@ -391,7 +391,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
template <typename CompletionToken,
|
||||
ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation>
|
||||
inline typename enable_if<
|
||||
inline typename constraint<
|
||||
detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
|
||||
(async_result<typename decay<CompletionToken>::type,
|
||||
@ -408,7 +408,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
template <typename CompletionToken,
|
||||
ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation>
|
||||
inline typename enable_if<
|
||||
inline typename constraint<
|
||||
!detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
|
||||
async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
@ -427,7 +427,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
template <typename CompletionToken, \
|
||||
ASIO_COMPLETION_SIGNATURE Signature, \
|
||||
typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
|
||||
inline typename enable_if< \
|
||||
inline typename constraint< \
|
||||
detail::async_result_has_initiate_memfn< \
|
||||
CompletionToken, Signature>::value, \
|
||||
ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, \
|
||||
@ -448,7 +448,7 @@ async_initiate(ASIO_MOVE_ARG(Initiation) initiation,
|
||||
template <typename CompletionToken, \
|
||||
ASIO_COMPLETION_SIGNATURE Signature, \
|
||||
typename Initiation, ASIO_VARIADIC_TPARAMS(n)> \
|
||||
inline typename enable_if< \
|
||||
inline typename constraint< \
|
||||
!detail::async_result_has_initiate_memfn< \
|
||||
CompletionToken, Signature>::value, \
|
||||
ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \
|
||||
|
@ -107,9 +107,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_datagram_socket(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -145,9 +145,10 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_datagram_socket(ExecutionContext& context,
|
||||
const protocol_type& protocol,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_socket<Protocol, Executor>(context, protocol)
|
||||
{
|
||||
}
|
||||
@ -191,9 +192,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_datagram_socket(ExecutionContext& context,
|
||||
const endpoint_type& endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, endpoint)
|
||||
{
|
||||
}
|
||||
@ -236,9 +237,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_datagram_socket(ExecutionContext& context,
|
||||
const protocol_type& protocol, const native_handle_type& native_socket,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
|
||||
{
|
||||
}
|
||||
@ -292,10 +293,10 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
basic_datagram_socket(basic_datagram_socket<Protocol1, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(std::move(other))
|
||||
{
|
||||
}
|
||||
@ -314,7 +315,7 @@ public:
|
||||
* constructor.
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value,
|
||||
basic_datagram_socket&
|
||||
|
@ -175,9 +175,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_deadline_timer(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -213,9 +213,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_deadline_timer(ExecutionContext& context, const time_type& expiry_time,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -257,9 +257,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_deadline_timer(ExecutionContext& context,
|
||||
const duration_type& expiry_time,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
|
@ -107,9 +107,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_raw_socket(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -144,9 +144,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_raw_socket(ExecutionContext& context, const protocol_type& protocol,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_socket<Protocol, Executor>(context, protocol)
|
||||
{
|
||||
}
|
||||
@ -189,9 +190,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_raw_socket(ExecutionContext& context, const endpoint_type& endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, endpoint)
|
||||
{
|
||||
}
|
||||
@ -234,9 +235,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_raw_socket(ExecutionContext& context,
|
||||
const protocol_type& protocol, const native_handle_type& native_socket,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
|
||||
{
|
||||
}
|
||||
@ -289,10 +290,10 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
basic_raw_socket(basic_raw_socket<Protocol1, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(std::move(other))
|
||||
{
|
||||
}
|
||||
@ -309,7 +310,7 @@ public:
|
||||
* constructor.
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value,
|
||||
basic_raw_socket&
|
||||
|
@ -106,9 +106,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_seq_packet_socket(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -149,9 +149,10 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_seq_packet_socket(ExecutionContext& context,
|
||||
const protocol_type& protocol,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_socket<Protocol, Executor>(context, protocol)
|
||||
{
|
||||
}
|
||||
@ -196,9 +197,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_seq_packet_socket(ExecutionContext& context,
|
||||
const endpoint_type& endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, endpoint)
|
||||
{
|
||||
}
|
||||
@ -241,9 +242,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_seq_packet_socket(ExecutionContext& context,
|
||||
const protocol_type& protocol, const native_handle_type& native_socket,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
|
||||
{
|
||||
}
|
||||
@ -299,10 +300,10 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
basic_seq_packet_socket(basic_seq_packet_socket<Protocol1, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(std::move(other))
|
||||
{
|
||||
}
|
||||
@ -321,7 +322,7 @@ public:
|
||||
* constructor.
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value,
|
||||
basic_seq_packet_socket&
|
||||
|
@ -108,10 +108,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_serial_port(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
basic_serial_port
|
||||
>::type* = 0)
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -150,9 +150,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_serial_port(ExecutionContext& context, const char* device,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -194,9 +194,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_serial_port(ExecutionContext& context, const std::string& device,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -243,9 +243,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_serial_port(ExecutionContext& context,
|
||||
const native_handle_type& native_serial_port,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
|
@ -130,9 +130,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_signal_set(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -175,9 +176,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_signal_set(ExecutionContext& context, int signal_number_1,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -233,9 +235,10 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_signal_set(ExecutionContext& context, int signal_number_1,
|
||||
int signal_number_2,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -301,9 +304,10 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_signal_set(ExecutionContext& context, int signal_number_1,
|
||||
int signal_number_2, int signal_number_3,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
|
@ -125,9 +125,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_socket(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -165,9 +165,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_socket(ExecutionContext& context, const protocol_type& protocol,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -219,9 +220,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_socket(ExecutionContext& context, const endpoint_type& endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -272,9 +273,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_socket(ExecutionContext& context, const protocol_type& protocol,
|
||||
const native_handle_type& native_socket,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -331,10 +332,10 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
basic_socket(basic_socket<Protocol1, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(std::move(other.impl_))
|
||||
{
|
||||
}
|
||||
@ -350,7 +351,7 @@ public:
|
||||
* constructed using the @c basic_socket(const executor_type&) constructor.
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value,
|
||||
basic_socket&
|
||||
|
@ -141,9 +141,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_socket_acceptor(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -183,9 +183,10 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_socket_acceptor(ExecutionContext& context,
|
||||
const protocol_type& protocol,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -271,9 +272,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_socket_acceptor(ExecutionContext& context,
|
||||
const endpoint_type& endpoint, bool reuse_addr = true,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -336,9 +337,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_socket_acceptor(ExecutionContext& context,
|
||||
const protocol_type& protocol, const native_handle_type& native_acceptor,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -399,10 +400,10 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
basic_socket_acceptor(basic_socket_acceptor<Protocol1, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(std::move(other.impl_))
|
||||
{
|
||||
}
|
||||
@ -420,7 +421,7 @@ public:
|
||||
* constructor.
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value,
|
||||
basic_socket_acceptor&
|
||||
@ -1258,9 +1259,9 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
void accept(basic_socket<Protocol1, Executor1>& peer,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol, Protocol1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
asio::error_code ec;
|
||||
impl_.get_service().accept(impl_.get_implementation(),
|
||||
@ -1294,9 +1295,9 @@ public:
|
||||
template <typename Protocol1, typename Executor1>
|
||||
ASIO_SYNC_OP_VOID accept(
|
||||
basic_socket<Protocol1, Executor1>& peer, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol, Protocol1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
impl_.get_service().accept(impl_.get_implementation(),
|
||||
peer, static_cast<endpoint_type*>(0), ec);
|
||||
@ -1349,9 +1350,9 @@ public:
|
||||
async_accept(basic_socket<Protocol1, Executor1>& peer,
|
||||
ASIO_MOVE_ARG(AcceptHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol, Protocol1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return async_initiate<AcceptHandler, void (asio::error_code)>(
|
||||
initiate_async_accept(this), handler,
|
||||
@ -1624,10 +1625,10 @@ public:
|
||||
template <typename Executor1>
|
||||
typename Protocol::socket::template rebind_executor<Executor1>::other
|
||||
accept(const Executor1& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor1>::value
|
||||
|| execution::is_executor<Executor1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
asio::error_code ec;
|
||||
typename Protocol::socket::template
|
||||
@ -1664,9 +1665,9 @@ public:
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other
|
||||
accept(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
asio::error_code ec;
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
@ -1707,10 +1708,10 @@ public:
|
||||
template <typename Executor1>
|
||||
typename Protocol::socket::template rebind_executor<Executor1>::other
|
||||
accept(const Executor1& ex, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor1>::value
|
||||
|| execution::is_executor<Executor1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typename Protocol::socket::template
|
||||
rebind_executor<Executor1>::other peer(ex);
|
||||
@ -1750,9 +1751,9 @@ public:
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other
|
||||
accept(ExecutionContext& context, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other peer(context);
|
||||
@ -1814,10 +1815,10 @@ public:
|
||||
async_accept(const Executor1& ex,
|
||||
ASIO_MOVE_ARG(MoveAcceptHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor1>::value
|
||||
|| execution::is_executor<Executor1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typedef typename Protocol::socket::template rebind_executor<
|
||||
Executor1>::other other_socket_type;
|
||||
@ -1884,9 +1885,9 @@ public:
|
||||
async_accept(ExecutionContext& context,
|
||||
ASIO_MOVE_ARG(MoveAcceptHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typedef typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other other_socket_type;
|
||||
@ -2073,10 +2074,10 @@ public:
|
||||
template <typename Executor1>
|
||||
typename Protocol::socket::template rebind_executor<Executor1>::other
|
||||
accept(const Executor1& ex, endpoint_type& peer_endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor1>::value
|
||||
|| execution::is_executor<Executor1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
asio::error_code ec;
|
||||
typename Protocol::socket::template
|
||||
@ -2119,9 +2120,9 @@ public:
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other
|
||||
accept(ExecutionContext& context, endpoint_type& peer_endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
asio::error_code ec;
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
@ -2169,10 +2170,10 @@ public:
|
||||
typename Protocol::socket::template rebind_executor<Executor1>::other
|
||||
accept(const executor_type& ex,
|
||||
endpoint_type& peer_endpoint, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor1>::value
|
||||
|| execution::is_executor<Executor1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typename Protocol::socket::template
|
||||
rebind_executor<Executor1>::other peer(ex);
|
||||
@ -2219,9 +2220,9 @@ public:
|
||||
typename ExecutionContext::executor_type>::other
|
||||
accept(ExecutionContext& context,
|
||||
endpoint_type& peer_endpoint, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other peer(context);
|
||||
@ -2290,10 +2291,10 @@ public:
|
||||
async_accept(const Executor1& ex, endpoint_type& peer_endpoint,
|
||||
ASIO_MOVE_ARG(MoveAcceptHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor1>::value
|
||||
|| execution::is_executor<Executor1>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typedef typename Protocol::socket::template rebind_executor<
|
||||
Executor1>::other other_socket_type;
|
||||
@ -2367,9 +2368,9 @@ public:
|
||||
endpoint_type& peer_endpoint,
|
||||
ASIO_MOVE_ARG(MoveAcceptHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
typedef typename Protocol::socket::template rebind_executor<
|
||||
typename ExecutionContext::executor_type>::other other_socket_type;
|
||||
|
@ -111,9 +111,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_stream_socket(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -150,9 +150,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_stream_socket(ExecutionContext& context, const protocol_type& protocol,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_socket<Protocol, Executor>(context, protocol)
|
||||
{
|
||||
}
|
||||
@ -195,9 +196,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
basic_stream_socket(ExecutionContext& context, const endpoint_type& endpoint,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, endpoint)
|
||||
{
|
||||
}
|
||||
@ -240,9 +241,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_stream_socket(ExecutionContext& context,
|
||||
const protocol_type& protocol, const native_handle_type& native_socket,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(context, protocol, native_socket)
|
||||
{
|
||||
}
|
||||
@ -295,10 +296,10 @@ public:
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
basic_stream_socket(basic_stream_socket<Protocol1, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_socket<Protocol, Executor>(std::move(other))
|
||||
{
|
||||
}
|
||||
@ -315,7 +316,7 @@ public:
|
||||
* constructor.
|
||||
*/
|
||||
template <typename Protocol1, typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Protocol1, Protocol>::value
|
||||
&& is_convertible<Executor1, Executor>::value,
|
||||
basic_stream_socket&
|
||||
|
@ -191,9 +191,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_waitable_timer(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -230,9 +230,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_waitable_timer(ExecutionContext& context,
|
||||
const time_point& expiry_time,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -273,9 +273,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_waitable_timer(ExecutionContext& context,
|
||||
const duration& expiry_time,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -337,9 +337,9 @@ public:
|
||||
template <typename Executor1>
|
||||
basic_waitable_timer(
|
||||
basic_waitable_timer<Clock, WaitTraits, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(std::move(other.impl_))
|
||||
{
|
||||
}
|
||||
@ -357,7 +357,7 @@ public:
|
||||
* constructor.
|
||||
*/
|
||||
template <typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Executor1, Executor>::value,
|
||||
basic_waitable_timer&
|
||||
>::type operator=(basic_waitable_timer<Clock, WaitTraits, Executor1>&& other)
|
||||
|
@ -488,9 +488,9 @@ private:
|
||||
template <typename Executor, typename T>
|
||||
inline executor_binder<typename decay<T>::type, Executor>
|
||||
bind_executor(const Executor& ex, ASIO_MOVE_ARG(T) t,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return executor_binder<typename decay<T>::type, Executor>(
|
||||
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,
|
||||
typename ExecutionContext::executor_type>
|
||||
bind_executor(ExecutionContext& ctx, ASIO_MOVE_ARG(T) t,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type* = 0)
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type = 0)
|
||||
{
|
||||
return executor_binder<typename decay<T>::type,
|
||||
typename ExecutionContext::executor_type>(
|
||||
|
@ -386,9 +386,9 @@ private:
|
||||
/// Get an iterator to the first element in a buffer sequence.
|
||||
template <typename MutableBuffer>
|
||||
inline const mutable_buffer* buffer_sequence_begin(const MutableBuffer& b,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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));
|
||||
}
|
||||
@ -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.
|
||||
template <typename ConstBuffer>
|
||||
inline const const_buffer* buffer_sequence_begin(const ConstBuffer& b,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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));
|
||||
}
|
||||
@ -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.
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.begin())
|
||||
>::type = 0) ASIO_NOEXCEPT -> decltype(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.
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.begin())
|
||||
>::type = 0) ASIO_NOEXCEPT -> decltype(c.begin())
|
||||
{
|
||||
return c.begin();
|
||||
}
|
||||
@ -431,20 +431,20 @@ inline auto buffer_sequence_begin(const C& c,
|
||||
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
{
|
||||
return c.begin();
|
||||
}
|
||||
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
{
|
||||
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.
|
||||
template <typename MutableBuffer>
|
||||
inline const mutable_buffer* buffer_sequence_end(const MutableBuffer& b,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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;
|
||||
}
|
||||
@ -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.
|
||||
template <typename ConstBuffer>
|
||||
inline const const_buffer* buffer_sequence_end(const ConstBuffer& b,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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;
|
||||
}
|
||||
@ -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.
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.end())
|
||||
>::type = 0) ASIO_NOEXCEPT -> decltype(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.
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT -> decltype(c.end())
|
||||
>::type = 0) ASIO_NOEXCEPT -> decltype(c.end())
|
||||
{
|
||||
return c.end();
|
||||
}
|
||||
@ -508,20 +508,20 @@ inline auto buffer_sequence_end(const C& c,
|
||||
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
{
|
||||
return c.end();
|
||||
}
|
||||
|
||||
template <typename 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 const_buffer*>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
{
|
||||
return c.end();
|
||||
}
|
||||
|
@ -105,10 +105,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
co_spawn(const Executor& ex, awaitable<T, AwaitableExecutor> a,
|
||||
CompletionToken&& token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
|
||||
&& is_convertible<Executor, AwaitableExecutor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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,
|
||||
CompletionToken&& token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
|
||||
&& is_convertible<Executor, AwaitableExecutor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Spawn a new coroutined-based thread of execution.
|
||||
/**
|
||||
@ -227,11 +227,11 @@ co_spawn(ExecutionContext& ctx, awaitable<T, AwaitableExecutor> a,
|
||||
CompletionToken&& token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
&& is_convertible<typename ExecutionContext::executor_type,
|
||||
AwaitableExecutor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Spawn a new coroutined-based thread of execution.
|
||||
/**
|
||||
@ -286,11 +286,11 @@ co_spawn(ExecutionContext& ctx, awaitable<void, AwaitableExecutor> a,
|
||||
CompletionToken&& token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
&& is_convertible<typename ExecutionContext::executor_type,
|
||||
AwaitableExecutor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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,
|
||||
CompletionToken&& token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Spawn a new coroutined-based thread of execution.
|
||||
/**
|
||||
@ -456,9 +456,9 @@ co_spawn(ExecutionContext& ctx, F&& f,
|
||||
CompletionToken&& token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
} // namespace asio
|
||||
|
||||
|
@ -90,8 +90,8 @@ struct is_endpoint_sequence
|
||||
template <typename Protocol, typename Executor, typename EndpointSequence>
|
||||
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type* = 0);
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type = 0);
|
||||
|
||||
/// 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>
|
||||
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, asio::error_code& ec,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type* = 0);
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_DEPRECATED)
|
||||
/// (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>
|
||||
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
|
||||
/// 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>
|
||||
Iterator connect(basic_socket<Protocol, Executor>& s,
|
||||
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)
|
||||
|
||||
/// 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 Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, ConnectCondition connect_condition,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type* = 0);
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type = 0);
|
||||
|
||||
/// 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,
|
||||
const EndpointSequence& endpoints, ConnectCondition connect_condition,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type* = 0);
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_DEPRECATED)
|
||||
/// (Deprecated: Use range overload.) Establishes a socket connection by trying
|
||||
@ -422,7 +422,7 @@ template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename ConnectCondition>
|
||||
Iterator connect(basic_socket<Protocol, Executor>& s,
|
||||
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
|
||||
/// each endpoint in a sequence.
|
||||
@ -463,7 +463,7 @@ template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename ConnectCondition>
|
||||
Iterator connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
||||
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)
|
||||
|
||||
/// 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,
|
||||
ASIO_MOVE_ARG(RangeConnectHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type* = 0);
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_DEPRECATED)
|
||||
/// (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,
|
||||
ASIO_MOVE_ARG(IteratorConnectHandler) handler
|
||||
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)
|
||||
|
||||
/// 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,
|
||||
ASIO_MOVE_ARG(RangeConnectHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type* = 0);
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_DEPRECATED)
|
||||
/// (Deprecated: Use range overload.) Asynchronously establishes a socket
|
||||
@ -952,7 +952,7 @@ async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
||||
ConnectCondition connect_condition,
|
||||
ASIO_MOVE_ARG(IteratorConnectHandler) handler
|
||||
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)
|
||||
|
||||
/// Asynchronously establishes a socket connection by trying each endpoint in a
|
||||
|
@ -101,9 +101,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
const Executor& ex,
|
||||
ASIO_MOVE_ARG(CompletionToken) token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value || is_executor<Executor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type* = 0);
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type = 0);
|
||||
|
||||
} // namespace asio
|
||||
|
||||
|
@ -61,9 +61,9 @@ public:
|
||||
/// that to construct the adapted executor.
|
||||
template <typename OtherExecutor>
|
||||
executor_with_default(const OtherExecutor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<OtherExecutor, InnerExecutor>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
: InnerExecutor(ex)
|
||||
{
|
||||
}
|
||||
|
@ -143,6 +143,14 @@ template <typename Head, typename... Tail> struct conjunction<Head, Tail...> :
|
||||
|
||||
#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
|
||||
|
||||
#endif // ASIO_DETAIL_TYPE_TRAITS_HPP
|
||||
|
@ -91,9 +91,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
const Executor& ex,
|
||||
ASIO_MOVE_ARG(CompletionToken) token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value || is_executor<Executor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type* = 0);
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type = 0);
|
||||
|
||||
} // namespace asio
|
||||
|
||||
|
@ -220,9 +220,9 @@ private:
|
||||
/// Create an @ref executor_work_guard object.
|
||||
template <typename Executor>
|
||||
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
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return executor_work_guard<Executor>(ex);
|
||||
}
|
||||
@ -231,9 +231,9 @@ inline executor_work_guard<Executor> make_work_guard(const Executor& ex,
|
||||
template <typename ExecutionContext>
|
||||
inline executor_work_guard<typename ExecutionContext::executor_type>
|
||||
make_work_guard(ExecutionContext& ctx,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return executor_work_guard<typename ExecutionContext::executor_type>(
|
||||
ctx.get_executor());
|
||||
@ -243,15 +243,15 @@ make_work_guard(ExecutionContext& ctx,
|
||||
template <typename T>
|
||||
inline executor_work_guard<typename associated_executor<T>::type>
|
||||
make_work_guard(const T& t,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
!is_executor<T>::value
|
||||
>::type* = 0,
|
||||
typename enable_if<
|
||||
>::type = 0,
|
||||
typename constraint<
|
||||
!execution::is_executor<T>::value
|
||||
>::type* = 0,
|
||||
typename enable_if<
|
||||
>::type = 0,
|
||||
typename constraint<
|
||||
!is_convertible<T&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return executor_work_guard<typename associated_executor<T>::type>(
|
||||
associated_executor<T>::get(t));
|
||||
@ -261,9 +261,9 @@ make_work_guard(const T& t,
|
||||
template <typename T, typename Executor>
|
||||
inline executor_work_guard<typename associated_executor<T, Executor>::type>
|
||||
make_work_guard(const T& t, const Executor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return executor_work_guard<typename associated_executor<T, Executor>::type>(
|
||||
associated_executor<T, Executor>::get(t, ex));
|
||||
@ -274,18 +274,18 @@ template <typename T, typename ExecutionContext>
|
||||
inline executor_work_guard<typename associated_executor<T,
|
||||
typename ExecutionContext::executor_type>::type>
|
||||
make_work_guard(const T& t, ExecutionContext& ctx,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
!is_executor<T>::value
|
||||
>::type* = 0,
|
||||
typename enable_if<
|
||||
>::type = 0,
|
||||
typename constraint<
|
||||
!execution::is_executor<T>::value
|
||||
>::type* = 0,
|
||||
typename enable_if<
|
||||
>::type = 0,
|
||||
typename constraint<
|
||||
!is_convertible<T&, execution_context&>::value
|
||||
>::type* = 0,
|
||||
typename enable_if<
|
||||
>::type = 0,
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return executor_work_guard<typename associated_executor<T,
|
||||
typename ExecutionContext::executor_type>::type>(
|
||||
|
@ -80,9 +80,9 @@ public:
|
||||
/// that to construct the adapted executor.
|
||||
template <typename OtherExecutor>
|
||||
executor_with_default(const OtherExecutor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<OtherExecutor, InnerExecutor>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
: InnerExecutor(ex)
|
||||
{
|
||||
}
|
||||
|
@ -198,10 +198,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
CompletionToken, void(std::exception_ptr, T))
|
||||
co_spawn(const Executor& ex,
|
||||
awaitable<T, AwaitableExecutor> a, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
|
||||
&& is_convertible<Executor, AwaitableExecutor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void(std::exception_ptr, T)>(
|
||||
detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)),
|
||||
@ -215,10 +215,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
CompletionToken, void(std::exception_ptr))
|
||||
co_spawn(const Executor& ex,
|
||||
awaitable<void, AwaitableExecutor> a, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
(is_executor<Executor>::value || execution::is_executor<Executor>::value)
|
||||
&& is_convertible<Executor, AwaitableExecutor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void(std::exception_ptr)>(
|
||||
detail::initiate_co_spawn<AwaitableExecutor>(AwaitableExecutor(ex)),
|
||||
@ -233,11 +233,11 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
CompletionToken, void(std::exception_ptr, T))
|
||||
co_spawn(ExecutionContext& ctx,
|
||||
awaitable<T, AwaitableExecutor> a, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
&& is_convertible<typename ExecutionContext::executor_type,
|
||||
AwaitableExecutor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return (co_spawn)(ctx.get_executor(), std::move(a),
|
||||
std::forward<CompletionToken>(token));
|
||||
@ -250,11 +250,11 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(
|
||||
CompletionToken, void(std::exception_ptr))
|
||||
co_spawn(ExecutionContext& ctx,
|
||||
awaitable<void, AwaitableExecutor> a, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
&& is_convertible<typename ExecutionContext::executor_type,
|
||||
AwaitableExecutor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return (co_spawn)(ctx.get_executor(), std::move(a),
|
||||
std::forward<CompletionToken>(token));
|
||||
@ -266,9 +266,9 @@ template <typename Executor, typename F,
|
||||
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
|
||||
typename detail::awaitable_signature<typename result_of<F()>::type>::type)
|
||||
co_spawn(const Executor& ex, F&& f, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken,
|
||||
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,
|
||||
typename detail::awaitable_signature<typename result_of<F()>::type>::type)
|
||||
co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return (co_spawn)(ctx.get_executor(), std::forward<F>(f),
|
||||
std::forward<CompletionToken>(token));
|
||||
|
@ -105,8 +105,8 @@ namespace detail
|
||||
template <typename Protocol, typename Executor, typename EndpointSequence>
|
||||
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type*)
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type)
|
||||
{
|
||||
asio::error_code 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>
|
||||
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, asio::error_code& ec,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type*)
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type)
|
||||
{
|
||||
return detail::deref_connect_result<Protocol>(
|
||||
connect(s, endpoints.begin(), endpoints.end(),
|
||||
@ -128,7 +128,7 @@ typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
#if !defined(ASIO_NO_DEPRECATED)
|
||||
template <typename Protocol, typename Executor, typename Iterator>
|
||||
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;
|
||||
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>
|
||||
inline Iterator connect(basic_socket<Protocol, Executor>& s,
|
||||
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);
|
||||
}
|
||||
@ -166,8 +166,8 @@ template <typename Protocol, typename Executor,
|
||||
typename EndpointSequence, typename ConnectCondition>
|
||||
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, ConnectCondition connect_condition,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type*)
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
typename Protocol::endpoint result = connect(
|
||||
@ -181,8 +181,8 @@ template <typename Protocol, typename Executor,
|
||||
typename Protocol::endpoint connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, ConnectCondition connect_condition,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type*)
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type)
|
||||
{
|
||||
return detail::deref_connect_result<Protocol>(
|
||||
connect(s, endpoints.begin(), endpoints.end(),
|
||||
@ -194,7 +194,7 @@ template <typename Protocol, typename Executor,
|
||||
typename Iterator, typename ConnectCondition>
|
||||
Iterator connect(basic_socket<Protocol, Executor>& s,
|
||||
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;
|
||||
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,
|
||||
Iterator begin, ConnectCondition connect_condition,
|
||||
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);
|
||||
}
|
||||
@ -816,8 +816,8 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
|
||||
async_connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints,
|
||||
ASIO_MOVE_ARG(RangeConnectHandler) handler,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type*)
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type)
|
||||
{
|
||||
return async_initiate<RangeConnectHandler,
|
||||
void (asio::error_code, typename Protocol::endpoint)>(
|
||||
@ -833,7 +833,7 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(IteratorConnectHandler,
|
||||
void (asio::error_code, Iterator))
|
||||
async_connect(basic_socket<Protocol, Executor>& s, Iterator begin,
|
||||
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,
|
||||
void (asio::error_code, Iterator)>(
|
||||
@ -865,8 +865,8 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(RangeConnectHandler,
|
||||
async_connect(basic_socket<Protocol, Executor>& s,
|
||||
const EndpointSequence& endpoints, ConnectCondition connect_condition,
|
||||
ASIO_MOVE_ARG(RangeConnectHandler) handler,
|
||||
typename enable_if<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type*)
|
||||
typename constraint<is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type)
|
||||
{
|
||||
return async_initiate<RangeConnectHandler,
|
||||
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,
|
||||
ConnectCondition connect_condition,
|
||||
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,
|
||||
void (asio::error_code, Iterator)>(
|
||||
|
@ -224,9 +224,9 @@ template <typename Executor,
|
||||
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value || is_executor<Executor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_defer_with_executor<Executor>(ex), token);
|
||||
@ -236,8 +236,8 @@ template <typename ExecutionContext,
|
||||
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) defer(
|
||||
ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_defer_with_executor<
|
||||
|
@ -219,9 +219,9 @@ template <typename Executor,
|
||||
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value || is_executor<Executor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_dispatch_with_executor<Executor>(ex), token);
|
||||
@ -231,8 +231,8 @@ template <typename ExecutionContext,
|
||||
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) dispatch(
|
||||
ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_dispatch_with_executor<
|
||||
|
@ -224,9 +224,9 @@ template <typename Executor,
|
||||
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
const Executor& ex, ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value || is_executor<Executor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_post_with_executor<Executor>(ex), token);
|
||||
@ -236,8 +236,8 @@ template <typename ExecutionContext,
|
||||
ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
ExecutionContext& ctx, ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_post_with_executor<
|
||||
|
@ -65,9 +65,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
|
||||
typename CompletionCondition>
|
||||
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return detail::read_buffer_sequence(s, buffers,
|
||||
asio::buffer_sequence_begin(buffers),
|
||||
@ -76,9 +76,9 @@ std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
|
||||
template <typename SyncReadStream, typename MutableBufferSequence>
|
||||
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code 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>
|
||||
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return read(s, buffers, transfer_all(), ec);
|
||||
}
|
||||
@ -100,9 +100,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
|
||||
typename CompletionCondition>
|
||||
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = read(s, buffers,
|
||||
@ -118,10 +118,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
|
||||
std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
typename decay<DynamicBuffer_v1>::type b(
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
|
||||
@ -150,10 +150,10 @@ std::size_t read(SyncReadStream& s,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = read(s,
|
||||
@ -166,10 +166,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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),
|
||||
transfer_all(), ec);
|
||||
@ -180,10 +180,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
|
||||
inline std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = read(s,
|
||||
@ -239,9 +239,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
DynamicBuffer_v2& b = buffers;
|
||||
|
||||
@ -271,9 +271,9 @@ std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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>
|
||||
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return read(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
transfer_all(), ec);
|
||||
@ -297,9 +297,9 @@ template <typename SyncReadStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
inline std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
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))
|
||||
async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -844,10 +844,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
async_read(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_read(s,
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
@ -864,10 +864,10 @@ async_read(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
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))
|
||||
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_read(s,
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
@ -1184,9 +1184,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
|
@ -77,10 +77,10 @@ namespace detail
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
char delim, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
typename decay<DynamicBuffer_v1>::type b(
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
|
||||
@ -147,10 +147,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
ASIO_STRING_VIEW_PARAM delim,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
typename decay<DynamicBuffer_v1>::type b(
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
|
||||
@ -229,10 +229,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
const boost::regex& expr,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
typename decay<DynamicBuffer_v1>::type b(
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
|
||||
@ -313,11 +313,11 @@ template <typename SyncReadStream,
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
MatchCondition match_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = read_until(s,
|
||||
@ -332,11 +332,11 @@ template <typename SyncReadStream,
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
MatchCondition match_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
typename decay<DynamicBuffer_v1>::type b(
|
||||
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>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
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);
|
||||
}
|
||||
@ -452,7 +452,7 @@ template <typename SyncReadStream, typename Allocator, typename MatchCondition>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
asio::basic_streambuf<Allocator>& b,
|
||||
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);
|
||||
}
|
||||
@ -464,9 +464,9 @@ inline std::size_t read_until(SyncReadStream& s,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
DynamicBuffer_v2 buffers, char delim,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
char delim, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
DynamicBuffer_v2& b = buffers;
|
||||
|
||||
@ -533,9 +533,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
DynamicBuffer_v2& b = buffers;
|
||||
|
||||
@ -614,9 +614,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
DynamicBuffer_v2 buffers, const boost::regex& expr,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
const boost::regex& expr, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
DynamicBuffer_v2& b = buffers;
|
||||
|
||||
@ -697,10 +697,10 @@ template <typename SyncReadStream,
|
||||
typename DynamicBuffer_v2, typename MatchCondition>
|
||||
inline std::size_t read_until(SyncReadStream& s,
|
||||
DynamicBuffer_v2 buffers, MatchCondition match_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = read_until(s,
|
||||
@ -714,10 +714,10 @@ template <typename SyncReadStream,
|
||||
typename DynamicBuffer_v2, typename MatchCondition>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
MatchCondition match_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
DynamicBuffer_v2& b = buffers;
|
||||
|
||||
@ -1061,10 +1061,10 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -1369,10 +1369,10 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
ASIO_STRING_VIEW_PARAM delim,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -1683,10 +1683,10 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
const boost::regex& expr,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -1995,11 +1995,11 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -2061,7 +2061,7 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
async_read_until(AsyncReadStream& s,
|
||||
asio::basic_streambuf<Allocator>& b,
|
||||
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),
|
||||
match_condition, ASIO_MOVE_CAST(ReadHandler)(handler));
|
||||
@ -2362,9 +2362,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (asio::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
char delim, ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -2677,9 +2677,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
async_read_until(AsyncReadStream& s,
|
||||
DynamicBuffer_v2 buffers, ASIO_STRING_VIEW_PARAM delim,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -2997,9 +2997,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (asio::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
const boost::regex& expr, ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -3315,10 +3315,10 @@ ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (asio::error_code, std::size_t))
|
||||
async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
|
@ -434,10 +434,10 @@ template <typename Handler, typename Function>
|
||||
void spawn(ASIO_MOVE_ARG(Handler) handler,
|
||||
ASIO_MOVE_ARG(Function) function,
|
||||
const boost::coroutines::attributes& attributes,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
!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<Function>::type function_type;
|
||||
@ -475,9 +475,9 @@ template <typename Function, typename Executor>
|
||||
inline void spawn(const Executor& ex,
|
||||
ASIO_MOVE_ARG(Function) function,
|
||||
const boost::coroutines::attributes& attributes,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::spawn(asio::strand<Executor>(ex),
|
||||
ASIO_MOVE_CAST(Function)(function), attributes);
|
||||
@ -511,8 +511,8 @@ template <typename Function, typename ExecutionContext>
|
||||
inline void spawn(ExecutionContext& ctx,
|
||||
ASIO_MOVE_ARG(Function) function,
|
||||
const boost::coroutines::attributes& attributes,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type)
|
||||
{
|
||||
asio::spawn(ctx.get_executor(),
|
||||
ASIO_MOVE_CAST(Function)(function), attributes);
|
||||
|
@ -63,9 +63,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
|
||||
typename CompletionCondition>
|
||||
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return detail::write_buffer_sequence(s, 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>
|
||||
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code 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>
|
||||
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return write(s, buffers, transfer_all(), ec);
|
||||
}
|
||||
@ -98,9 +98,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
|
||||
typename CompletionCondition>
|
||||
inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = write(s, buffers,
|
||||
@ -116,10 +116,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
|
||||
std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
typename decay<DynamicBuffer_v1>::type b(
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers));
|
||||
@ -133,10 +133,10 @@ std::size_t write(SyncWriteStream& s,
|
||||
template <typename SyncWriteStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = write(s,
|
||||
@ -150,10 +150,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1>
|
||||
inline std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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),
|
||||
transfer_all(), ec);
|
||||
@ -164,10 +164,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
|
||||
inline std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
std::size_t bytes_transferred = write(s,
|
||||
@ -223,9 +223,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
std::size_t bytes_transferred = write(s, buffers.data(0, buffers.size()),
|
||||
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>
|
||||
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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>
|
||||
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return write(s, ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
transfer_all(), ec);
|
||||
@ -262,9 +262,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
inline std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
asio::error_code ec;
|
||||
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,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
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))
|
||||
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
@ -780,10 +780,10 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
async_write(AsyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_write(s,
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers),
|
||||
@ -800,10 +800,10 @@ async_write(AsyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
|
||||
&& !is_dynamic_buffer_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
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))
|
||||
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_write(s,
|
||||
ASIO_MOVE_CAST(DynamicBuffer_v2)(buffers),
|
||||
@ -1086,9 +1086,9 @@ inline ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type*)
|
||||
>::type)
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (asio::error_code, std::size_t)>(
|
||||
|
@ -119,9 +119,9 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_resolver(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -158,9 +158,9 @@ public:
|
||||
*/
|
||||
template <typename Executor1>
|
||||
basic_resolver(basic_resolver<InternetProtocol, Executor1>&& other,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Executor1, Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(std::move(other.impl_))
|
||||
{
|
||||
}
|
||||
@ -196,7 +196,7 @@ public:
|
||||
* constructed using the @c basic_resolver(const executor_type&) constructor.
|
||||
*/
|
||||
template <typename Executor1>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<Executor1, Executor>::value,
|
||||
basic_resolver&
|
||||
>::type operator=(basic_resolver<InternetProtocol, Executor1>&& other)
|
||||
|
@ -99,9 +99,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_descriptor(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -145,9 +146,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_descriptor(ExecutionContext& context,
|
||||
const native_handle_type& native_descriptor,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
|
@ -91,9 +91,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_stream_descriptor(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_descriptor<Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -133,9 +134,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_stream_descriptor(ExecutionContext& context,
|
||||
const native_handle_type& native_descriptor,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_descriptor<Executor>(context, native_descriptor)
|
||||
{
|
||||
}
|
||||
|
@ -97,9 +97,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
const Executor& ex,
|
||||
ASIO_MOVE_ARG(CompletionToken) token
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value || is_executor<Executor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type* = 0);
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type = 0);
|
||||
|
||||
} // namespace asio
|
||||
|
||||
|
@ -75,9 +75,9 @@ namespace asio {
|
||||
*/
|
||||
template <typename SyncReadStream, typename MutableBufferSequence>
|
||||
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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>
|
||||
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Attempt to read a certain amount of data from a stream before returning.
|
||||
/**
|
||||
@ -172,9 +172,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
|
||||
typename CompletionCondition>
|
||||
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Attempt to read a certain amount of data from a stream before returning.
|
||||
/**
|
||||
@ -219,9 +219,9 @@ template <typename SyncReadStream, typename MutableBufferSequence,
|
||||
typename CompletionCondition>
|
||||
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#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>
|
||||
std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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.
|
||||
/**
|
||||
@ -290,10 +290,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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.
|
||||
/**
|
||||
@ -336,10 +336,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
|
||||
std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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.
|
||||
/**
|
||||
@ -383,10 +383,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1,
|
||||
std::size_t read(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_EXTENSIONS)
|
||||
#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>
|
||||
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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>
|
||||
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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>
|
||||
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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>
|
||||
std::size_t read(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Start an asynchronous operation to read a certain amount of data from a
|
||||
/// stream.
|
||||
@ -850,9 +850,9 @@ async_read(AsyncReadStream& s, const MutableBufferSequence& buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_mutable_buffer_sequence<MutableBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
|
||||
|
||||
@ -918,10 +918,10 @@ async_read(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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
|
||||
/// stream.
|
||||
@ -995,10 +995,10 @@ async_read(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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_IOSTREAM)
|
||||
@ -1198,9 +1198,9 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Start an asynchronous operation to read a certain amount of data from a
|
||||
/// stream.
|
||||
@ -1273,9 +1273,9 @@ async_read(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
@ -133,10 +133,10 @@ struct is_match_condition
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Read data into a dynamic buffer sequence until it contains a specified
|
||||
/// delimiter.
|
||||
@ -176,10 +176,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
char delim, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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
|
||||
/// delimiter.
|
||||
@ -236,10 +236,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
ASIO_STRING_VIEW_PARAM delim,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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
|
||||
/// delimiter.
|
||||
@ -280,10 +280,10 @@ std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_EXTENSIONS)
|
||||
#if defined(ASIO_HAS_BOOST_REGEX) \
|
||||
@ -347,10 +347,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
const boost::regex& expr,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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
|
||||
/// contains matches a regular expression.
|
||||
@ -392,10 +392,10 @@ template <typename SyncReadStream, typename DynamicBuffer_v1>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#endif // defined(ASIO_HAS_BOOST_REGEX)
|
||||
// || defined(GENERATING_DOCUMENTATION)
|
||||
@ -507,11 +507,11 @@ template <typename SyncReadStream,
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
MatchCondition match_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v1<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
|
||||
/// match.
|
||||
@ -571,11 +571,11 @@ template <typename SyncReadStream,
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
MatchCondition match_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v1<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)
|
||||
|
||||
@ -955,7 +955,7 @@ std::size_t read_until(SyncReadStream& s,
|
||||
template <typename SyncReadStream, typename Allocator, typename MatchCondition>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
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.
|
||||
/**
|
||||
@ -1012,7 +1012,7 @@ template <typename SyncReadStream, typename Allocator, typename MatchCondition>
|
||||
std::size_t read_until(SyncReadStream& s,
|
||||
asio::basic_streambuf<Allocator>& b,
|
||||
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_EXTENSIONS)
|
||||
@ -1073,9 +1073,9 @@ std::size_t read_until(SyncReadStream& s,
|
||||
*/
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Read data into a dynamic buffer sequence until it contains a specified
|
||||
/// delimiter.
|
||||
@ -1114,9 +1114,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
char delim, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Read data into a dynamic buffer sequence until it contains a specified
|
||||
/// delimiter.
|
||||
@ -1172,9 +1172,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_STRING_VIEW_PARAM delim,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Read data into a dynamic buffer sequence until it contains a specified
|
||||
/// delimiter.
|
||||
@ -1213,9 +1213,9 @@ std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
template <typename SyncReadStream, typename DynamicBuffer_v2>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_STRING_VIEW_PARAM delim, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_EXTENSIONS)
|
||||
#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>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
const boost::regex& expr,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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
|
||||
/// 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>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
const boost::regex& expr, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#endif // defined(ASIO_HAS_BOOST_REGEX)
|
||||
// || defined(GENERATING_DOCUMENTATION)
|
||||
@ -1434,10 +1434,10 @@ template <typename SyncReadStream,
|
||||
typename DynamicBuffer_v2, typename MatchCondition>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
MatchCondition match_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::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
|
||||
/// match.
|
||||
@ -1496,10 +1496,10 @@ template <typename SyncReadStream,
|
||||
typename DynamicBuffer_v2, typename MatchCondition>
|
||||
std::size_t read_until(SyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
MatchCondition match_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#endif // !defined(ASIO_NO_EXTENSIONS)
|
||||
|
||||
@ -1610,10 +1610,10 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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
|
||||
/// until it contains a specified delimiter.
|
||||
@ -1710,10 +1710,10 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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_HAS_BOOST_REGEX) \
|
||||
@ -1817,10 +1817,10 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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)
|
||||
// || defined(GENERATING_DOCUMENTATION)
|
||||
@ -1967,11 +1967,11 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v1<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)
|
||||
|
||||
@ -2395,7 +2395,7 @@ async_read_until(AsyncReadStream& s,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
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_EXTENSIONS)
|
||||
@ -2494,9 +2494,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers, char delim,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Start an asynchronous operation to read data into a dynamic buffer sequence
|
||||
/// until it contains a specified delimiter.
|
||||
@ -2592,9 +2592,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_EXTENSIONS)
|
||||
#if defined(ASIO_HAS_BOOST_REGEX) \
|
||||
@ -2697,9 +2697,9 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#endif // defined(ASIO_HAS_BOOST_REGEX)
|
||||
// || defined(GENERATING_DOCUMENTATION)
|
||||
@ -2845,10 +2845,10 @@ async_read_until(AsyncReadStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(ReadHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncReadStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_match_condition<MatchCondition>::value
|
||||
&& is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#endif // !defined(ASIO_NO_EXTENSIONS)
|
||||
|
||||
|
@ -225,10 +225,10 @@ void spawn(ASIO_MOVE_ARG(Handler) handler,
|
||||
ASIO_MOVE_ARG(Function) function,
|
||||
const boost::coroutines::attributes& attributes
|
||||
= boost::coroutines::attributes(),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
!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.
|
||||
/**
|
||||
@ -268,9 +268,9 @@ void spawn(const Executor& ex,
|
||||
ASIO_MOVE_ARG(Function) function,
|
||||
const boost::coroutines::attributes& attributes
|
||||
= boost::coroutines::attributes(),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Start a new stackful coroutine that executes on a given strand.
|
||||
/**
|
||||
@ -330,8 +330,8 @@ void spawn(ExecutionContext& ctx,
|
||||
ASIO_MOVE_ARG(Function) function,
|
||||
const boost::coroutines::attributes& attributes
|
||||
= boost::coroutines::attributes(),
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type* = 0);
|
||||
typename constraint<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type = 0);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
@ -47,13 +47,13 @@ public:
|
||||
/// Construct a strand for the specified executor.
|
||||
template <typename Executor1>
|
||||
explicit strand(const Executor1& e,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
conditional<
|
||||
!is_same<Executor1, strand>::value,
|
||||
is_convertible<Executor1, Executor>,
|
||||
false_type
|
||||
>::type::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: executor_(e),
|
||||
impl_(strand::create_implementation(executor_))
|
||||
{
|
||||
@ -166,7 +166,7 @@ public:
|
||||
* ... @endcode
|
||||
*/
|
||||
template <typename Property>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
can_query<const Executor&, Property>::value,
|
||||
typename query_result<const Executor&, Property>::type
|
||||
>::type query(const Property& p) const
|
||||
@ -187,7 +187,7 @@ public:
|
||||
* asio::execution::blocking.never); @endcode
|
||||
*/
|
||||
template <typename Property>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
can_require<const Executor&, Property>::value,
|
||||
strand<typename decay<
|
||||
typename require_result<const Executor&, Property>::type
|
||||
@ -212,7 +212,7 @@ public:
|
||||
* asio::execution::blocking.never); @endcode
|
||||
*/
|
||||
template <typename Property>
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
can_prefer<const Executor&, Property>::value,
|
||||
strand<typename decay<
|
||||
typename prefer_result<const Executor&, Property>::type
|
||||
@ -270,8 +270,9 @@ public:
|
||||
* function object must be: @code void function(); @endcode
|
||||
*/
|
||||
template <typename Function>
|
||||
typename enable_if<
|
||||
execution::can_execute<const Executor&, Function>::value
|
||||
typename constraint<
|
||||
execution::can_execute<const Executor&, Function>::value,
|
||||
void
|
||||
>::type execute(ASIO_MOVE_ARG(Function) f) const
|
||||
{
|
||||
detail::strand_executor_service::execute(impl_,
|
||||
@ -381,9 +382,9 @@ private:
|
||||
|
||||
template <typename InnerExecutor>
|
||||
static implementation_type create_implementation(const InnerExecutor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
can_query<InnerExecutor, execution::context_t>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return use_service<detail::strand_executor_service>(
|
||||
asio::query(ex, execution::context)).create_implementation();
|
||||
@ -391,9 +392,9 @@ private:
|
||||
|
||||
template <typename InnerExecutor>
|
||||
static implementation_type create_implementation(const InnerExecutor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
!can_query<InnerExecutor, execution::context_t>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return use_service<detail::strand_executor_service>(
|
||||
ex.context()).create_implementation();
|
||||
@ -419,9 +420,9 @@ private:
|
||||
/// Create a @ref strand object for an executor.
|
||||
template <typename Executor>
|
||||
inline strand<Executor> make_strand(const Executor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_executor<Executor>::value || execution::is_executor<Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return strand<Executor>(ex);
|
||||
}
|
||||
@ -430,9 +431,9 @@ inline strand<Executor> make_strand(const Executor& ex,
|
||||
template <typename ExecutionContext>
|
||||
inline strand<typename ExecutionContext::executor_type>
|
||||
make_strand(ExecutionContext& ctx,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
return strand<typename ExecutionContext::executor_type>(ctx.get_executor());
|
||||
}
|
||||
|
@ -108,9 +108,9 @@ struct use_awaitable_t
|
||||
/// that to construct the adapted executor.
|
||||
template <typename OtherExecutor>
|
||||
executor_with_default(const OtherExecutor& ex,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<OtherExecutor, InnerExecutor>::value
|
||||
>::type* = 0) ASIO_NOEXCEPT
|
||||
>::type = 0) ASIO_NOEXCEPT
|
||||
: InnerExecutor(ex)
|
||||
{
|
||||
}
|
||||
|
@ -96,10 +96,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_object_handle(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
basic_object_handle
|
||||
>::type* = 0)
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -142,9 +142,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_object_handle(ExecutionContext& context,
|
||||
const native_handle_type& native_handle,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
|
@ -99,10 +99,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_overlapped_handle(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
basic_overlapped_handle
|
||||
>::type* = 0)
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
}
|
||||
@ -145,9 +145,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_overlapped_handle(ExecutionContext& context,
|
||||
const native_handle_type& native_handle,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(0, 0, context)
|
||||
{
|
||||
asio::error_code ec;
|
||||
|
@ -84,10 +84,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_random_access_handle(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
basic_random_access_handle
|
||||
>::type* = 0)
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_overlapped_handle<Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -127,9 +127,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_random_access_handle(ExecutionContext& context,
|
||||
const native_handle_type& handle,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_overlapped_handle<Executor>(context, handle)
|
||||
{
|
||||
}
|
||||
|
@ -86,10 +86,10 @@ public:
|
||||
*/
|
||||
template <typename ExecutionContext>
|
||||
explicit basic_stream_handle(ExecutionContext& context,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value,
|
||||
basic_stream_handle
|
||||
>::type* = 0)
|
||||
defaulted_constraint
|
||||
>::type = defaulted_constraint())
|
||||
: basic_overlapped_handle<Executor>(context)
|
||||
{
|
||||
}
|
||||
@ -128,9 +128,9 @@ public:
|
||||
template <typename ExecutionContext>
|
||||
basic_stream_handle(ExecutionContext& context,
|
||||
const native_handle_type& handle,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: basic_overlapped_handle<Executor>(context, handle)
|
||||
{
|
||||
}
|
||||
|
@ -52,9 +52,9 @@ public:
|
||||
template <typename ExecutionContext, typename Handler>
|
||||
explicit overlapped_ptr(ExecutionContext& context,
|
||||
ASIO_MOVE_ARG(Handler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler))
|
||||
{
|
||||
}
|
||||
@ -63,10 +63,10 @@ public:
|
||||
template <typename Executor, typename Handler>
|
||||
explicit overlapped_ptr(const Executor& ex,
|
||||
ASIO_MOVE_ARG(Handler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value
|
||||
|| is_executor<Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
: impl_(ex, ASIO_MOVE_CAST(Handler)(handler))
|
||||
{
|
||||
}
|
||||
@ -86,9 +86,9 @@ public:
|
||||
/// object.
|
||||
template <typename ExecutionContext, typename Handler>
|
||||
void reset(ExecutionContext& context, ASIO_MOVE_ARG(Handler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_convertible<ExecutionContext&, execution_context&>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
impl_.reset(context.get_executor(), ASIO_MOVE_CAST(Handler)(handler));
|
||||
}
|
||||
@ -97,10 +97,10 @@ public:
|
||||
/// object.
|
||||
template <typename Executor, typename Handler>
|
||||
void reset(const Executor& ex, ASIO_MOVE_ARG(Handler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
execution::is_executor<Executor>::value
|
||||
|| is_executor<Executor>::value
|
||||
>::type* = 0)
|
||||
>::type = 0)
|
||||
{
|
||||
impl_.reset(ex, ASIO_MOVE_CAST(Handler)(handler));
|
||||
}
|
||||
|
@ -75,9 +75,9 @@ namespace asio {
|
||||
*/
|
||||
template <typename SyncWriteStream, typename ConstBufferSequence>
|
||||
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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>
|
||||
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Write a certain amount of data to a stream before returning.
|
||||
/**
|
||||
@ -172,9 +172,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
|
||||
typename CompletionCondition>
|
||||
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Write a certain amount of data to a stream before returning.
|
||||
/**
|
||||
@ -219,9 +219,9 @@ template <typename SyncWriteStream, typename ConstBufferSequence,
|
||||
typename CompletionCondition>
|
||||
std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#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>
|
||||
std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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.
|
||||
/**
|
||||
@ -291,10 +291,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1>
|
||||
std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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.
|
||||
/**
|
||||
@ -337,10 +337,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
|
||||
std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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.
|
||||
/**
|
||||
@ -384,10 +384,10 @@ template <typename SyncWriteStream, typename DynamicBuffer_v1,
|
||||
std::size_t write(SyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
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_v2<typename decay<DynamicBuffer_v1>::type>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_EXTENSIONS)
|
||||
#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>
|
||||
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// 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>
|
||||
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Write a certain amount of data to a stream before returning.
|
||||
/**
|
||||
@ -643,9 +643,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Write a certain amount of data to a stream before returning.
|
||||
/**
|
||||
@ -688,9 +688,9 @@ template <typename SyncWriteStream, typename DynamicBuffer_v2,
|
||||
typename CompletionCondition>
|
||||
std::size_t write(SyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition, asio::error_code& ec,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
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_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncWriteStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Start an asynchronous operation to write a certain amount of data to a
|
||||
/// stream.
|
||||
@ -844,9 +844,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
async_write(AsyncWriteStream& s, const ConstBufferSequence& buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_const_buffer_sequence<ConstBufferSequence>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
|
||||
|
||||
@ -905,10 +905,10 @@ async_write(AsyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncWriteStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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
|
||||
/// stream.
|
||||
@ -977,10 +977,10 @@ async_write(AsyncWriteStream& s,
|
||||
ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v1<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_IOSTREAM)
|
||||
@ -1161,9 +1161,9 @@ async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler
|
||||
ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename AsyncWriteStream::executor_type),
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/// Start an asynchronous operation to write a certain amount of data to a
|
||||
/// stream.
|
||||
@ -1231,9 +1231,9 @@ ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
async_write(AsyncWriteStream& s, DynamicBuffer_v2 buffers,
|
||||
CompletionCondition completion_condition,
|
||||
ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
typename enable_if<
|
||||
typename constraint<
|
||||
is_dynamic_buffer_v2<DynamicBuffer_v2>::value
|
||||
>::type* = 0);
|
||||
>::type = 0);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user