// execution/connect.hpp
// ~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#else // defined(GENERATING_DOCUMENTATION)
-namespace asio_execution_connect_fn {
+namespace boost_asio_execution_connect_fn {
using boost::asio::conditional;
using boost::asio::declval;
ill_formed
};
-template <typename S, typename R, typename = void>
+template <typename S, typename R, typename = void,
+ typename = void, typename = void, typename = void>
struct call_traits
{
BOOST_ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed);
template <typename S, typename R>
struct call_traits<S, void(R),
typename enable_if<
- (
- connect_member<S, R>::is_valid
- &&
- is_operation_state<typename connect_member<S, R>::result_type>::value
- &&
- is_sender<typename remove_cvref<S>::type>::value
- )
+ connect_member<S, R>::is_valid
+ >::type,
+ typename enable_if<
+ is_operation_state<typename connect_member<S, R>::result_type>::value
+ >::type,
+ typename enable_if<
+ is_sender<typename remove_cvref<S>::type>::value
>::type> :
connect_member<S, R>
{
template <typename S, typename R>
struct call_traits<S, void(R),
typename enable_if<
- (
- !connect_member<S, R>::is_valid
- &&
- connect_free<S, R>::is_valid
- &&
- is_operation_state<typename connect_free<S, R>::result_type>::value
- &&
- is_sender<typename remove_cvref<S>::type>::value
- )
+ !connect_member<S, R>::is_valid
+ >::type,
+ typename enable_if<
+ connect_free<S, R>::is_valid
+ >::type,
+ typename enable_if<
+ is_operation_state<typename connect_free<S, R>::result_type>::value
+ >::type,
+ typename enable_if<
+ is_sender<typename remove_cvref<S>::type>::value
>::type> :
connect_free<S, R>
{
template <typename S, typename R>
struct call_traits<S, void(R),
typename enable_if<
- (
- !connect_member<S, R>::is_valid
- &&
- !connect_free<S, R>::is_valid
- &&
- is_receiver<R>::value
- &&
- conditional<
- !is_as_receiver<
- typename remove_cvref<R>::type
- >::value,
- is_executor_of<
- typename remove_cvref<S>::type,
- as_invocable<typename remove_cvref<R>::type, S>
- >,
- false_type
- >::type::value
- )
+ !connect_member<S, R>::is_valid
+ >::type,
+ typename enable_if<
+ !connect_free<S, R>::is_valid
+ >::type,
+ typename enable_if<
+ is_receiver<R>::value
+ >::type,
+ typename enable_if<
+ conditional<
+ !is_as_receiver<
+ typename remove_cvref<R>::type
+ >::value,
+ is_executor_of<
+ typename remove_cvref<S>::type,
+ as_invocable<typename remove_cvref<R>::type, S>
+ >,
+ false_type
+ >::type::value
>::type>
{
BOOST_ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter);
template <typename T>
const T static_instance<T>::instance = {};
-} // namespace asio_execution_connect_fn
+} // namespace boost_asio_execution_connect_fn
namespace boost {
namespace asio {
namespace execution {
namespace {
-static BOOST_ASIO_CONSTEXPR const asio_execution_connect_fn::impl&
- connect = asio_execution_connect_fn::static_instance<>::instance;
+static BOOST_ASIO_CONSTEXPR const boost_asio_execution_connect_fn::impl&
+ connect = boost_asio_execution_connect_fn::static_instance<>::instance;
} // namespace
template <typename S, typename R>
struct can_connect :
integral_constant<bool,
- asio_execution_connect_fn::call_traits<S, void(R)>::overload !=
- asio_execution_connect_fn::ill_formed>
+ boost_asio_execution_connect_fn::call_traits<S, void(R)>::overload !=
+ boost_asio_execution_connect_fn::ill_formed>
{
};
template <typename S, typename R>
struct is_nothrow_connect :
integral_constant<bool,
- asio_execution_connect_fn::call_traits<S, void(R)>::is_noexcept>
+ boost_asio_execution_connect_fn::call_traits<S, void(R)>::is_noexcept>
{
};
template <typename S, typename R>
struct connect_result
{
- typedef typename asio_execution_connect_fn::call_traits<
+ typedef typename boost_asio_execution_connect_fn::call_traits<
S, void(R)>::result_type type;
};