Skip to content

Commit

Permalink
Fix ambiguous overloads error with clang 19.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Dec 2, 2024
1 parent 959a4bb commit 91b38c3
Showing 1 changed file with 42 additions and 3 deletions.
45 changes: 42 additions & 3 deletions asio/include/asio/execution/blocking_adaptation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,36 @@ const T disallowed_t<I>::static_query_v;
#endif // defined(ASIO_HAS_DEDUCED_STATIC_QUERY_TRAIT)
// && defined(ASIO_HAS_SFINAE_VARIABLE_TEMPLATES)

template <typename>
struct is_blocking_adaptation_t : false_type
{
};

template <int I>
struct is_blocking_adaptation_t<blocking_adaptation_t<I>> : true_type
{
};

template <typename>
struct is_allowed_t : false_type
{
};

template <int I>
struct is_allowed_t<allowed_t<I>> : true_type
{
};

template <typename>
struct is_disallowed_t : false_type
{
};

template <int I>
struct is_disallowed_t<disallowed_t<I>> : true_type
{
};

template <typename Executor>
class adapter
{
Expand Down Expand Up @@ -509,7 +539,10 @@ class adapter

template <typename Property>
enable_if_t<
can_query<const Executor&, Property>::value,
can_query<const Executor&, Property>::value
&& !is_blocking_adaptation_t<Property>::value
&& !is_allowed_t<Property>::value
&& !is_disallowed_t<Property>::value,
query_result_t<const Executor&, Property>
> query(const Property& p) const
noexcept(is_nothrow_query<const Executor&, Property>::value)
Expand All @@ -525,7 +558,10 @@ class adapter

template <typename Property>
enable_if_t<
can_require<const Executor&, Property>::value,
can_require<const Executor&, Property>::value
&& !is_blocking_adaptation_t<Property>::value
&& !is_allowed_t<Property>::value
&& !is_disallowed_t<Property>::value,
adapter<decay_t<require_result_t<const Executor&, Property>>>
> require(const Property& p) const
noexcept(is_nothrow_require<const Executor&, Property>::value)
Expand All @@ -536,7 +572,10 @@ class adapter

template <typename Property>
enable_if_t<
can_prefer<const Executor&, Property>::value,
can_prefer<const Executor&, Property>::value
&& !is_blocking_adaptation_t<Property>::value
&& !is_allowed_t<Property>::value
&& !is_disallowed_t<Property>::value,
adapter<decay_t<prefer_result_t<const Executor&, Property>>>
> prefer(const Property& p) const
noexcept(is_nothrow_prefer<const Executor&, Property>::value)
Expand Down

0 comments on commit 91b38c3

Please sign in to comment.