diff --git a/asio/include/asio/execution/blocking.hpp b/asio/include/asio/execution/blocking.hpp index 2f2c3991..ebfa5c13 100644 --- a/asio/include/asio/execution/blocking.hpp +++ b/asio/include/asio/execution/blocking.hpp @@ -270,8 +270,12 @@ struct blocking_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -283,9 +287,15 @@ struct blocking_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -297,10 +307,18 @@ struct blocking_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -353,7 +371,9 @@ struct blocking_t const Executor& ex, convertible_from_blocking_t, typename enable_if< !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -373,8 +393,12 @@ struct blocking_t const Executor& ex, convertible_from_blocking_t, typename enable_if< !can_query::value - && !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + !can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -468,10 +492,18 @@ struct possibly_t static ASIO_CONSTEXPR possibly_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::query_free::is_valid - && !can_query >::value - && !can_query >::value + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::query_free::is_valid + >::type* = 0, + typename enable_if< + !can_query >::value + >::type* = 0, + typename enable_if< + !can_query >::value >::type* = 0) ASIO_NOEXCEPT { return possibly_t(); @@ -755,7 +787,9 @@ struct always_t const Executor& e, const always_t&, typename enable_if< is_executor::value - && traits::static_require< + >::type* = 0, + typename enable_if< + traits::static_require< const Executor&, blocking_adaptation::allowed_t<0> >::is_valid diff --git a/asio/include/asio/execution/blocking_adaptation.hpp b/asio/include/asio/execution/blocking_adaptation.hpp index 49d364d7..fee7717e 100644 --- a/asio/include/asio/execution/blocking_adaptation.hpp +++ b/asio/include/asio/execution/blocking_adaptation.hpp @@ -225,8 +225,12 @@ struct blocking_adaptation_t typename enable_if< !traits::query_static_constexpr_member< T, blocking_adaptation_t>::is_valid - && !traits::query_member::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -239,9 +243,15 @@ struct blocking_adaptation_t typename enable_if< !traits::query_static_constexpr_member< T, blocking_adaptation_t>::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -299,7 +309,9 @@ struct blocking_adaptation_t const Executor& ex, convertible_from_blocking_adaptation_t, typename enable_if< !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -392,9 +404,15 @@ struct disallowed_t static ASIO_CONSTEXPR disallowed_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::query_free::is_valid - && !can_query >::value + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::query_free::is_valid + >::type* = 0, + typename enable_if< + !can_query >::value >::type* = 0) ASIO_NOEXCEPT { return disallowed_t(); diff --git a/asio/include/asio/execution/bulk_execute.hpp b/asio/include/asio/execution/bulk_execute.hpp index 001b6088..d3a08dd8 100644 --- a/asio/include/asio/execution/bulk_execute.hpp +++ b/asio/include/asio/execution/bulk_execute.hpp @@ -124,7 +124,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -135,15 +136,15 @@ struct call_traits template struct call_traits::value - && - bulk_execute_member::is_valid - && - is_sender< - typename bulk_execute_member::result_type - >::value - ) + is_convertible::value + >::type, + typename enable_if< + bulk_execute_member::is_valid + >::type, + typename enable_if< + is_sender< + typename bulk_execute_member::result_type + >::value >::type> : bulk_execute_member { @@ -153,17 +154,18 @@ struct call_traits struct call_traits::value - && - !bulk_execute_member::is_valid - && - bulk_execute_free::is_valid - && - is_sender< - typename bulk_execute_free::result_type - >::value - ) + is_convertible::value + >::type, + typename enable_if< + !bulk_execute_member::is_valid + >::type, + typename enable_if< + bulk_execute_free::is_valid + >::type, + typename enable_if< + is_sender< + typename bulk_execute_free::result_type + >::value >::type> : bulk_execute_free { @@ -173,26 +175,29 @@ struct call_traits struct call_traits::value - && - !bulk_execute_member::is_valid - && - !bulk_execute_free::is_valid - && - is_sender::value - && - is_same< - typename result_of< - F(typename executor_index::type>::type) - >::type, - typename result_of< - F(typename executor_index::type>::type) - >::type - >::value - && - static_require::is_valid - ) + is_convertible::value + >::type, + typename enable_if< + !bulk_execute_member::is_valid + >::type, + typename enable_if< + !bulk_execute_free::is_valid + >::type, + typename enable_if< + is_sender::value + >::type, + typename enable_if< + is_same< + typename result_of< + F(typename executor_index::type>::type) + >::type, + typename result_of< + F(typename executor_index::type>::type) + >::type + >::value + >::type, + typename enable_if< + static_require::is_valid >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); diff --git a/asio/include/asio/execution/bulk_guarantee.hpp b/asio/include/asio/execution/bulk_guarantee.hpp index 28b25854..158d350f 100644 --- a/asio/include/asio/execution/bulk_guarantee.hpp +++ b/asio/include/asio/execution/bulk_guarantee.hpp @@ -259,8 +259,12 @@ struct bulk_guarantee_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -272,9 +276,15 @@ struct bulk_guarantee_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -286,10 +296,18 @@ struct bulk_guarantee_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -344,7 +362,9 @@ struct bulk_guarantee_t const Executor& ex, convertible_from_bulk_guarantee_t, typename enable_if< !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -365,8 +385,12 @@ struct bulk_guarantee_t const Executor& ex, convertible_from_bulk_guarantee_t, typename enable_if< !can_query::value - && !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + !can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -463,10 +487,18 @@ struct unsequenced_t static ASIO_CONSTEXPR unsequenced_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::query_free::is_valid - && !can_query >::value - && !can_query >::value + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::query_free::is_valid + >::type* = 0, + typename enable_if< + !can_query >::value + >::type* = 0, + typename enable_if< + !can_query >::value >::type* = 0) ASIO_NOEXCEPT { return unsequenced_t(); diff --git a/asio/include/asio/execution/connect.hpp b/asio/include/asio/execution/connect.hpp index 47dd58b6..17a924bc 100644 --- a/asio/include/asio/execution/connect.hpp +++ b/asio/include/asio/execution/connect.hpp @@ -157,7 +157,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -168,13 +169,13 @@ struct call_traits template struct call_traits::is_valid - && - is_operation_state::result_type>::value - && - is_sender::type>::value - ) + connect_member::is_valid + >::type, + typename enable_if< + is_operation_state::result_type>::value + >::type, + typename enable_if< + is_sender::type>::value >::type> : connect_member { @@ -184,15 +185,16 @@ struct call_traits struct call_traits::is_valid - && - connect_free::is_valid - && - is_operation_state::result_type>::value - && - is_sender::type>::value - ) + !connect_member::is_valid + >::type, + typename enable_if< + connect_free::is_valid + >::type, + typename enable_if< + is_operation_state::result_type>::value + >::type, + typename enable_if< + is_sender::type>::value >::type> : connect_free { @@ -202,24 +204,25 @@ struct call_traits struct call_traits::is_valid - && - !connect_free::is_valid - && - is_receiver::value - && - conditional< - !is_as_receiver< - typename remove_cvref::type - >::value, - is_executor_of< - typename remove_cvref::type, - as_invocable::type, S> - >, - false_type - >::type::value - ) + !connect_member::is_valid + >::type, + typename enable_if< + !connect_free::is_valid + >::type, + typename enable_if< + is_receiver::value + >::type, + typename enable_if< + conditional< + !is_as_receiver< + typename remove_cvref::type + >::value, + is_executor_of< + typename remove_cvref::type, + as_invocable::type, S> + >, + false_type + >::type::value >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); diff --git a/asio/include/asio/execution/context_as.hpp b/asio/include/asio/execution/context_as.hpp index b4a93a51..f39376cf 100644 --- a/asio/include/asio/execution/context_as.hpp +++ b/asio/include/asio/execution/context_as.hpp @@ -120,7 +120,9 @@ struct context_as_t const Executor& ex, const context_as_t&, typename enable_if< is_same::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. diff --git a/asio/include/asio/execution/execute.hpp b/asio/include/asio/execution/execute.hpp index 277cd18a..483efbbc 100644 --- a/asio/include/asio/execution/execute.hpp +++ b/asio/include/asio/execution/execute.hpp @@ -86,7 +86,6 @@ void submit_helper(ASIO_MOVE_ARG(S) s, ASIO_MOVE_ARG(R) r); } // namespace asio namespace asio_execution_execute_fn { -using asio::conditional; using asio::decay; using asio::declval; using asio::enable_if; @@ -98,6 +97,7 @@ using asio::result_of; using asio::traits::execute_free; using asio::traits::execute_member; using asio::true_type; +using asio::void_type; void execute(); @@ -109,7 +109,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -118,9 +119,7 @@ struct call_traits template struct call_traits::is_valid - ) >::type> : execute_member { @@ -130,11 +129,10 @@ struct call_traits struct call_traits::is_valid - && - execute_free::is_valid - ) + !execute_member::is_valid + >::type, + typename enable_if< + execute_free::is_valid >::type> : execute_free { @@ -144,26 +142,19 @@ struct call_traits struct call_traits::is_valid - && - !execute_free::is_valid - && - conditional::type&()>::type - >::type::value - && - conditional< - !is_as_invocable< - typename decay::type - >::value, - is_sender_to< - T, - as_receiver::type, T> - >, - false_type - >::type::value - ) + !execute_member::is_valid + >::type, + typename enable_if< + !execute_free::is_valid + >::type, + typename void_type< + typename result_of::type&()>::type + >::type, + typename enable_if< + !is_as_invocable::type>::value + >::type, + typename enable_if< + is_sender_to::type, T> >::value >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); diff --git a/asio/include/asio/execution/executor.hpp b/asio/include/asio/execution/executor.hpp index fb64ebae..6a9006b0 100644 --- a/asio/include/asio/execution/executor.hpp +++ b/asio/include/asio/execution/executor.hpp @@ -35,34 +35,48 @@ namespace asio { namespace execution { namespace detail { -template -struct is_executor_of_impl_base : - integral_constant::type&()>::type - >::type::value - && is_constructible::type, F>::value - && is_move_constructible::type>::value -#if defined(ASIO_HAS_NOEXCEPT) - && is_nothrow_copy_constructible::value - && is_nothrow_destructible::value -#else // defined(ASIO_HAS_NOEXCEPT) - && is_copy_constructible::value - && is_destructible::value -#endif // defined(ASIO_HAS_NOEXCEPT) - && traits::equality_comparable::is_valid - && traits::equality_comparable::is_noexcept - > +template +struct is_executor_of_impl : false_type { }; template -struct is_executor_of_impl : - conditional< - can_execute::type, F>::value, - is_executor_of_impl_base, - false_type - >::type +struct is_executor_of_impl::type, F>::value + >::type, + typename void_type< + typename result_of::type&()>::type + >::type, + typename enable_if< + is_constructible::type, F>::value + >::type, + typename enable_if< + is_move_constructible::type>::value + >::type, +#if defined(ASIO_HAS_NOEXCEPT) + typename enable_if< + is_nothrow_copy_constructible::value + >::type, + typename enable_if< + is_nothrow_destructible::value + >::type, +#else // defined(ASIO_HAS_NOEXCEPT) + typename enable_if< + is_copy_constructible::value + >::type, + typename enable_if< + is_destructible::value + >::type, +#endif // defined(ASIO_HAS_NOEXCEPT) + typename enable_if< + traits::equality_comparable::is_valid + >::type, + typename enable_if< + traits::equality_comparable::is_noexcept + >::type> : true_type { }; diff --git a/asio/include/asio/execution/mapping.hpp b/asio/include/asio/execution/mapping.hpp index 43a27330..205d8141 100644 --- a/asio/include/asio/execution/mapping.hpp +++ b/asio/include/asio/execution/mapping.hpp @@ -254,8 +254,12 @@ struct mapping_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -267,9 +271,15 @@ struct mapping_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -281,10 +291,18 @@ struct mapping_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -337,7 +355,9 @@ struct mapping_t const Executor& ex, convertible_from_mapping_t, typename enable_if< !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -357,8 +377,12 @@ struct mapping_t const Executor& ex, convertible_from_mapping_t, typename enable_if< !can_query::value - && !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + !can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -452,10 +476,18 @@ struct thread_t static ASIO_CONSTEXPR thread_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::query_free::is_valid - && !can_query >::value - && !can_query >::value + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::query_free::is_valid + >::type* = 0, + typename enable_if< + !can_query >::value + >::type* = 0, + typename enable_if< + !can_query >::value >::type* = 0) ASIO_NOEXCEPT { return thread_t(); diff --git a/asio/include/asio/execution/outstanding_work.hpp b/asio/include/asio/execution/outstanding_work.hpp index da585476..edb9c0b2 100644 --- a/asio/include/asio/execution/outstanding_work.hpp +++ b/asio/include/asio/execution/outstanding_work.hpp @@ -219,8 +219,12 @@ struct outstanding_work_t typename enable_if< !traits::query_static_constexpr_member< T, outstanding_work_t>::is_valid - && !traits::query_member::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -233,9 +237,15 @@ struct outstanding_work_t typename enable_if< !traits::query_static_constexpr_member< T, outstanding_work_t>::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -292,7 +302,9 @@ struct outstanding_work_t const Executor& ex, convertible_from_outstanding_work_t, typename enable_if< !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -385,9 +397,15 @@ struct untracked_t static ASIO_CONSTEXPR untracked_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::query_free::is_valid - && !can_query >::value + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::query_free::is_valid + >::type* = 0, + typename enable_if< + !can_query >::value >::type* = 0) ASIO_NOEXCEPT { return untracked_t(); diff --git a/asio/include/asio/execution/prefer_only.hpp b/asio/include/asio/execution/prefer_only.hpp index 9823dade..5e0bba8f 100644 --- a/asio/include/asio/execution/prefer_only.hpp +++ b/asio/include/asio/execution/prefer_only.hpp @@ -220,7 +220,9 @@ struct prefer_only : prefer(const Executor& ex, const prefer_only& p, typename enable_if< is_same::value - && can_prefer::value + >::type* = 0, + typename enable_if< + can_prefer::value >::type* = 0) #if !defined(ASIO_MSVC) \ && !defined(__clang__) // Clang crashes if noexcept is used here. @@ -238,7 +240,9 @@ struct prefer_only : query(const Executor& ex, const prefer_only& p, typename enable_if< is_same::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(ASIO_MSVC) \ && !defined(__clang__) // Clang crashes if noexcept is used here. diff --git a/asio/include/asio/execution/relationship.hpp b/asio/include/asio/execution/relationship.hpp index 35f07494..fff8d38a 100644 --- a/asio/include/asio/execution/relationship.hpp +++ b/asio/include/asio/execution/relationship.hpp @@ -218,8 +218,12 @@ struct relationship_t typename enable_if< !traits::query_static_constexpr_member< T, relationship_t>::is_valid - && !traits::query_member::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -232,9 +236,15 @@ struct relationship_t typename enable_if< !traits::query_static_constexpr_member< T, relationship_t>::is_valid - && !traits::query_member::is_valid - && !traits::static_query::is_valid - && traits::static_query::is_valid + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::static_query::is_valid + >::type* = 0, + typename enable_if< + traits::static_query::is_valid >::type* = 0) ASIO_NOEXCEPT { return traits::static_query::value(); @@ -290,7 +300,9 @@ struct relationship_t const Executor& ex, convertible_from_relationship_t, typename enable_if< !can_query::value - && can_query::value + >::type* = 0, + typename enable_if< + can_query::value >::type* = 0) #if !defined(__clang__) // Clang crashes if noexcept is used here. #if defined(ASIO_MSVC) // Visual C++ wants the type to be qualified. @@ -383,9 +395,15 @@ struct fork_t static ASIO_CONSTEXPR fork_t static_query( typename enable_if< !traits::query_static_constexpr_member::is_valid - && !traits::query_member::is_valid - && !traits::query_free::is_valid - && !can_query >::value + >::type* = 0, + typename enable_if< + !traits::query_member::is_valid + >::type* = 0, + typename enable_if< + !traits::query_free::is_valid + >::type* = 0, + typename enable_if< + !can_query >::value >::type* = 0) ASIO_NOEXCEPT { return fork_t(); diff --git a/asio/include/asio/execution/schedule.hpp b/asio/include/asio/execution/schedule.hpp index 1262735f..95ecc9f1 100644 --- a/asio/include/asio/execution/schedule.hpp +++ b/asio/include/asio/execution/schedule.hpp @@ -86,7 +86,7 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -97,9 +97,7 @@ struct call_traits template struct call_traits::is_valid - ) + schedule_member::is_valid >::type> : schedule_member { @@ -109,11 +107,10 @@ struct call_traits struct call_traits::is_valid - && - schedule_free::is_valid - ) + !schedule_member::is_valid + >::type, + typename enable_if< + schedule_free::is_valid >::type> : schedule_free { @@ -123,13 +120,13 @@ struct call_traits struct call_traits::is_valid - && - !schedule_free::is_valid - && - is_executor::type>::value - ) + !schedule_member::is_valid + >::type, + typename enable_if< + !schedule_free::is_valid + >::type, + typename enable_if< + is_executor::type>::value >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = identity); diff --git a/asio/include/asio/execution/set_done.hpp b/asio/include/asio/execution/set_done.hpp index 5b45b7eb..1ec0d556 100644 --- a/asio/include/asio/execution/set_done.hpp +++ b/asio/include/asio/execution/set_done.hpp @@ -83,7 +83,7 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -94,9 +94,7 @@ struct call_traits template struct call_traits::is_valid - ) + set_done_member::is_valid >::type> : set_done_member { @@ -106,11 +104,10 @@ struct call_traits struct call_traits::is_valid - && - set_done_free::is_valid - ) + !set_done_member::is_valid + >::type, + typename enable_if< + set_done_free::is_valid >::type> : set_done_free { diff --git a/asio/include/asio/execution/set_error.hpp b/asio/include/asio/execution/set_error.hpp index aa701465..f09fded6 100644 --- a/asio/include/asio/execution/set_error.hpp +++ b/asio/include/asio/execution/set_error.hpp @@ -83,7 +83,7 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -94,9 +94,7 @@ struct call_traits template struct call_traits::is_valid - ) + set_error_member::is_valid >::type> : set_error_member { @@ -106,11 +104,10 @@ struct call_traits struct call_traits::is_valid - && - set_error_free::is_valid - ) + !set_error_member::is_valid + >::type, + typename enable_if< + set_error_free::is_valid >::type> : set_error_free { diff --git a/asio/include/asio/execution/set_value.hpp b/asio/include/asio/execution/set_value.hpp index f42b19db..a6834b88 100644 --- a/asio/include/asio/execution/set_value.hpp +++ b/asio/include/asio/execution/set_value.hpp @@ -86,7 +86,7 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -97,9 +97,7 @@ struct call_traits template struct call_traits::is_valid - ) + set_value_member::is_valid >::type> : set_value_member { @@ -109,11 +107,10 @@ struct call_traits struct call_traits::is_valid - && - set_value_free::is_valid - ) + !set_value_member::is_valid + >::type, + typename enable_if< + set_value_free::is_valid >::type> : set_value_free { diff --git a/asio/include/asio/execution/start.hpp b/asio/include/asio/execution/start.hpp index 194be147..49e3d1c3 100644 --- a/asio/include/asio/execution/start.hpp +++ b/asio/include/asio/execution/start.hpp @@ -80,7 +80,7 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -91,9 +91,7 @@ struct call_traits template struct call_traits::is_valid - ) + start_member::is_valid >::type> : start_member { @@ -103,11 +101,10 @@ struct call_traits struct call_traits::is_valid - && - start_free::is_valid - ) + !start_member::is_valid + >::type, + typename enable_if< + start_free::is_valid >::type> : start_free { diff --git a/asio/include/asio/execution/submit.hpp b/asio/include/asio/execution/submit.hpp index 719d27eb..39c05e97 100644 --- a/asio/include/asio/execution/submit.hpp +++ b/asio/include/asio/execution/submit.hpp @@ -125,7 +125,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -136,11 +137,10 @@ struct call_traits template struct call_traits::is_valid - && - is_sender_to::value - ) + submit_member::is_valid + >::type, + typename enable_if< + is_sender_to::value >::type> : submit_member { @@ -150,13 +150,13 @@ struct call_traits struct call_traits::is_valid - && - submit_free::is_valid - && - is_sender_to::value - ) + !submit_member::is_valid + >::type, + typename enable_if< + submit_free::is_valid + >::type, + typename enable_if< + is_sender_to::value >::type> : submit_free { @@ -166,13 +166,13 @@ struct call_traits struct call_traits::is_valid - && - !submit_free::is_valid - && - is_sender_to::value - ) + !submit_member::is_valid + >::type, + typename enable_if< + !submit_free::is_valid + >::type, + typename enable_if< + is_sender_to::value >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = adapter); diff --git a/asio/include/asio/executor_work_guard.hpp b/asio/include/asio/executor_work_guard.hpp index 5612f569..510939e7 100644 --- a/asio/include/asio/executor_work_guard.hpp +++ b/asio/include/asio/executor_work_guard.hpp @@ -31,7 +31,7 @@ namespace asio { #if !defined(ASIO_EXECUTOR_WORK_GUARD_DECL) #define ASIO_EXECUTOR_WORK_GUARD_DECL -template +template class executor_work_guard; #endif // !defined(ASIO_EXECUTOR_WORK_GUARD_DECL) @@ -41,7 +41,7 @@ class executor_work_guard; #if defined(GENERATING_DOCUMENTATION) template #else // defined(GENERATING_DOCUMENTATION) -template +template #endif // defined(GENERATING_DOCUMENTATION) class executor_work_guard { @@ -129,7 +129,10 @@ private: template class executor_work_guard::value && execution::is_executor::value + !is_executor::value + >::type, + typename enable_if< + execution::is_executor::value >::type> { public: @@ -241,9 +244,14 @@ template inline executor_work_guard::type> make_work_guard(const T& t, typename enable_if< - !is_executor::value && !execution::is_executor::value - && !is_convertible::value>::type* = 0) + !is_executor::value + >::type* = 0, + typename enable_if< + !execution::is_executor::value + >::type* = 0, + typename enable_if< + !is_convertible::value + >::type* = 0) { return executor_work_guard::type>( associated_executor::get(t)); @@ -267,9 +275,16 @@ inline executor_work_guard::type> make_work_guard(const T& t, ExecutionContext& ctx, typename enable_if< - !is_executor::value && !execution::is_executor::value - && !is_convertible::value - && is_convertible::value + !is_executor::value + >::type* = 0, + typename enable_if< + !execution::is_executor::value + >::type* = 0, + typename enable_if< + !is_convertible::value + >::type* = 0, + typename enable_if< + is_convertible::value >::type* = 0) { return executor_work_guard::value - && !execution::is_executor::value + >::type* = 0, + typename enable_if< + !execution::is_executor::value >::type* = 0) { return io_object.get_executor(); diff --git a/asio/include/asio/impl/defer.hpp b/asio/include/asio/impl/defer.hpp index 28e0a652..0288eb4c 100644 --- a/asio/include/asio/impl/defer.hpp +++ b/asio/include/asio/impl/defer.hpp @@ -103,7 +103,8 @@ public: execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< !detail::is_work_dispatcher_required< typename decay::type, Executor @@ -129,7 +130,8 @@ public: execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< detail::is_work_dispatcher_required< typename decay::type, Executor @@ -160,7 +162,8 @@ public: !execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< !detail::is_work_dispatcher_required< typename decay::type, Executor @@ -181,7 +184,8 @@ public: !execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< detail::is_work_dispatcher_required< typename decay::type, Executor diff --git a/asio/include/asio/impl/dispatch.hpp b/asio/include/asio/impl/dispatch.hpp index 9a542d1e..a4f4ca95 100644 --- a/asio/include/asio/impl/dispatch.hpp +++ b/asio/include/asio/impl/dispatch.hpp @@ -100,7 +100,8 @@ public: execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< !detail::is_work_dispatcher_required< typename decay::type, Executor @@ -125,7 +126,8 @@ public: execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< detail::is_work_dispatcher_required< typename decay::type, Executor @@ -155,7 +157,8 @@ public: !execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< !detail::is_work_dispatcher_required< typename decay::type, Executor @@ -176,7 +179,8 @@ public: !execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< detail::is_work_dispatcher_required< typename decay::type, Executor diff --git a/asio/include/asio/impl/post.hpp b/asio/include/asio/impl/post.hpp index d1d39116..b5511ace 100644 --- a/asio/include/asio/impl/post.hpp +++ b/asio/include/asio/impl/post.hpp @@ -103,7 +103,8 @@ public: execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< !detail::is_work_dispatcher_required< typename decay::type, Executor @@ -129,7 +130,8 @@ public: execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< detail::is_work_dispatcher_required< typename decay::type, Executor @@ -160,7 +162,8 @@ public: !execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< !detail::is_work_dispatcher_required< typename decay::type, Executor @@ -181,7 +184,8 @@ public: !execution::is_executor< typename conditional::type >::value - && + >::type* = 0, + typename enable_if< detail::is_work_dispatcher_required< typename decay::type, Executor diff --git a/asio/include/asio/prefer.hpp b/asio/include/asio/prefer.hpp index b885ab46..9936f6d8 100644 --- a/asio/include/asio/prefer.hpp +++ b/asio/include/asio/prefer.hpp @@ -143,7 +143,9 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -154,16 +156,16 @@ struct call_traits template struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_preferable - && - static_require::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_preferable + >::type, + typename enable_if< + static_require::is_valid >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = identity); @@ -179,18 +181,19 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_preferable - && - !static_require::is_valid - && - require_member::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_preferable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + require_member::is_valid >::type> : require_member { @@ -200,20 +203,22 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_preferable - && - !static_require::is_valid - && - !require_member::is_valid - && - require_free::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_preferable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + !require_member::is_valid + >::type, + typename enable_if< + require_free::is_valid >::type> : require_free { @@ -223,22 +228,25 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_preferable - && - !static_require::is_valid - && - !require_member::is_valid - && - !require_free::is_valid - && - prefer_member::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_preferable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + !require_member::is_valid + >::type, + typename enable_if< + !require_free::is_valid + >::type, + typename enable_if< + prefer_member::is_valid >::type> : prefer_member { @@ -248,24 +256,28 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_preferable - && - !static_require::is_valid - && - !require_member::is_valid - && - !require_free::is_valid - && - !prefer_member::is_valid - && - prefer_free::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_preferable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + !require_member::is_valid + >::type, + typename enable_if< + !require_free::is_valid + >::type, + typename enable_if< + !prefer_member::is_valid + >::type, + typename enable_if< + prefer_free::is_valid >::type> : prefer_free { @@ -275,24 +287,28 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_preferable - && - !static_require::is_valid - && - !require_member::is_valid - && - !require_free::is_valid - && - !prefer_member::is_valid - && - !prefer_free::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_preferable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + !require_member::is_valid + >::type, + typename enable_if< + !require_free::is_valid + >::type, + typename enable_if< + !prefer_member::is_valid + >::type, + typename enable_if< + !prefer_free::is_valid >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = identity); @@ -309,7 +325,8 @@ template struct call_traits::overload != ill_formed - && + >::type, + typename enable_if< call_traits< typename call_traits::result_type, void(P1) @@ -340,7 +357,8 @@ template struct call_traits::overload != ill_formed - && + >::type, + typename enable_if< call_traits< typename call_traits::result_type, void(P1, PN ASIO_ELLIPSIS) diff --git a/asio/include/asio/query.hpp b/asio/include/asio/query.hpp index 501b0198..39206bc2 100644 --- a/asio/include/asio/query.hpp +++ b/asio/include/asio/query.hpp @@ -118,7 +118,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -129,14 +130,13 @@ struct call_traits template struct call_traits::type, - typename decay::type - >::value - && - static_query::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + static_query::is_valid >::type> : static_query { @@ -146,16 +146,16 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - !static_query::is_valid - && - query_member::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + !static_query::is_valid + >::type, + typename enable_if< + query_member::is_valid >::type> : query_member { @@ -165,18 +165,19 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - !static_query::is_valid - && - !query_member::is_valid - && - query_free::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + !static_query::is_valid + >::type, + typename enable_if< + !query_member::is_valid + >::type, + typename enable_if< + query_free::is_valid >::type> : query_free { diff --git a/asio/include/asio/require.hpp b/asio/include/asio/require.hpp index 6114e6b8..8e4f5867 100644 --- a/asio/include/asio/require.hpp +++ b/asio/include/asio/require.hpp @@ -127,7 +127,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -138,16 +139,16 @@ struct call_traits template struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_requirable - && - static_require::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_requirable + >::type, + typename enable_if< + static_require::is_valid >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = identity); @@ -163,18 +164,19 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_requirable - && - !static_require::is_valid - && - require_member::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_requirable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + require_member::is_valid >::type> : require_member { @@ -184,20 +186,22 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_requirable - && - !static_require::is_valid - && - !require_member::is_valid - && - require_free::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_requirable + >::type, + typename enable_if< + !static_require::is_valid + >::type, + typename enable_if< + !require_member::is_valid + >::type, + typename enable_if< + require_free::is_valid >::type> : require_free { @@ -208,7 +212,8 @@ template struct call_traits::overload != ill_formed - && + >::type, + typename enable_if< call_traits< typename call_traits::result_type, void(P1) @@ -239,7 +244,8 @@ template struct call_traits::overload != ill_formed - && + >::type, + typename enable_if< call_traits< typename call_traits::result_type, void(P1, PN ASIO_ELLIPSIS) diff --git a/asio/include/asio/require_concept.hpp b/asio/include/asio/require_concept.hpp index d8785f6a..a2440377 100644 --- a/asio/include/asio/require_concept.hpp +++ b/asio/include/asio/require_concept.hpp @@ -125,7 +125,8 @@ enum overload_type ill_formed }; -template +template struct call_traits { ASIO_STATIC_CONSTEXPR(overload_type, overload = ill_formed); @@ -136,16 +137,16 @@ struct call_traits template struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_requirable_concept - && - static_require_concept::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_requirable_concept + >::type, + typename enable_if< + static_require_concept::is_valid >::type> { ASIO_STATIC_CONSTEXPR(overload_type, overload = identity); @@ -156,18 +157,19 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_requirable_concept - && - !static_require_concept::is_valid - && - require_concept_member::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_requirable_concept + >::type, + typename enable_if< + !static_require_concept::is_valid + >::type, + typename enable_if< + require_concept_member::is_valid >::type> : require_concept_member { @@ -177,20 +179,22 @@ struct call_traits struct call_traits::type, - typename decay::type - >::value - && - decay::type::is_requirable_concept - && - !static_require_concept::is_valid - && - !require_concept_member::is_valid - && - require_concept_free::is_valid - ) + is_applicable_property< + typename decay::type, + typename decay::type + >::value + >::type, + typename enable_if< + decay::type::is_requirable_concept + >::type, + typename enable_if< + !static_require_concept::is_valid + >::type, + typename enable_if< + !require_concept_member::is_valid + >::type, + typename enable_if< + require_concept_free::is_valid >::type> : require_concept_free { diff --git a/asio/include/asio/ts/netfwd.hpp b/asio/include/asio/ts/netfwd.hpp index 2642fca2..197e8d9d 100644 --- a/asio/include/asio/ts/netfwd.hpp +++ b/asio/include/asio/ts/netfwd.hpp @@ -45,7 +45,7 @@ class executor_binder; #if !defined(ASIO_EXECUTOR_WORK_GUARD_DECL) #define ASIO_EXECUTOR_WORK_GUARD_DECL -template +template class executor_work_guard; #endif // !defined(ASIO_EXECUTOR_WORK_GUARD_DECL)