Prevent target-acquiring adapter constructors from being considered during overload resolution for conversion.

This commit is contained in:
Christopher Kohlhoff 2020-08-01 01:02:47 +10:00
parent 388a04cdc1
commit 38fda8db75
2 changed files with 8 additions and 8 deletions

View File

@ -516,7 +516,7 @@ template <typename Executor>
class adapter
{
public:
explicit adapter(const Executor& e) ASIO_NOEXCEPT
adapter(int, const Executor& e) ASIO_NOEXCEPT
: executor_(e)
{
}
@ -602,7 +602,7 @@ public:
{
return adapter<typename decay<
typename require_result<const Executor&, Property>::type
>::type>(asio::require(executor_, p));
>::type>(0, asio::require(executor_, p));
}
template <typename Property>
@ -617,7 +617,7 @@ public:
{
return adapter<typename decay<
typename prefer_result<const Executor&, Property>::type
>::type>(asio::prefer(executor_, p));
>::type>(0, asio::prefer(executor_, p));
}
template <typename Function>
@ -731,7 +731,7 @@ struct always_t
>::is_valid
>::type* = 0)
{
return adapter<Executor>(e);
return adapter<Executor>(0, e);
}
};

View File

@ -415,7 +415,7 @@ template <typename Executor>
class adapter
{
public:
explicit adapter(const Executor& e) ASIO_NOEXCEPT
adapter(int, const Executor& e) ASIO_NOEXCEPT
: executor_(e)
{
}
@ -482,7 +482,7 @@ public:
{
return adapter<typename decay<
typename require_result<const Executor&, Property>::type
>::type>(asio::require(executor_, p));
>::type>(0, asio::require(executor_, p));
}
template <typename Property>
@ -497,7 +497,7 @@ public:
{
return adapter<typename decay<
typename prefer_result<const Executor&, Property>::type
>::type>(asio::prefer(executor_, p));
>::type>(0, asio::prefer(executor_, p));
}
template <typename Function>
@ -582,7 +582,7 @@ struct allowed_t
is_executor<Executor>::value
>::type* = 0)
{
return adapter<Executor>(e);
return adapter<Executor>(0, e);
}
};