>().require(static_cast(p))
)
)
-> decltype(
declval>().require(static_cast(p))
);
template
auto prefer(P&& p)
noexcept(
noexcept(
declval>().prefer(static_cast(p))
)
)
-> decltype(
declval>().prefer(static_cast(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
// && defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
typedef T type;
#endif // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
// && defined(ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT)
};
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == identity,
typename call_traits::result_type
>
operator()(T&& t, Property&&) const
noexcept(call_traits::is_noexcept)
{
return static_cast(t);
}
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == call_require_member,
typename call_traits::result_type
>
operator()(T&& t, Property&& p) const
noexcept(call_traits::is_noexcept)
{
return static_cast(t).require(static_cast(p));
}
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == call_require_free,
typename call_traits::result_type
>
operator()(T&& t, Property&& p) const
noexcept(call_traits::is_noexcept)
{
return require(static_cast(t), static_cast(p));
}
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == call_prefer_member,
typename call_traits::result_type
>
operator()(T&& t, Property&& p) const
noexcept(call_traits::is_noexcept)
{
return static_cast(t).prefer(static_cast(p));
}
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == call_prefer_free,
typename call_traits::result_type
>
operator()(T&& t, Property&& p) const
noexcept(call_traits::is_noexcept)
{
return prefer(static_cast(t), static_cast(p));
}
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == two_props,
typename call_traits::result_type
>
operator()(T&& t, P0&& p0, P1&& p1) const
noexcept(call_traits::is_noexcept)
{
return (*this)(
(*this)(static_cast(t), static_cast(p0)),
static_cast(p1));
}
template
ASIO_NODISCARD constexpr enable_if_t<
call_traits::overload == n_props,
typename call_traits::result_type
>
operator()(T&& t, P0&& p0, P1&& p1, PN&&... pn) const
noexcept(call_traits::is_noexcept)
{
return (*this)(
(*this)(static_cast(t), static_cast(p0)),
static_cast(p1), static_cast(pn)...);
}
};
template
struct static_instance
{
static const T instance;
};
template
const T static_instance::instance = {};
} // namespace asio_prefer_fn
namespace asio {
namespace {
static constexpr const asio_prefer_fn::impl&
prefer = asio_prefer_fn::static_instance<>::instance;
} // namespace
typedef asio_prefer_fn::impl prefer_t;
template
struct can_prefer :
integral_constant::overload
!= asio_prefer_fn::ill_formed>
{
};
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
constexpr bool can_prefer_v
= can_prefer::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
struct is_nothrow_prefer :
integral_constant::is_noexcept>
{
};
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
constexpr bool is_nothrow_prefer_v = is_nothrow_prefer::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
struct prefer_result
{
typedef typename asio_prefer_fn::call_traits<
prefer_t, T, void(Properties...)>::result_type type;
};
template
using prefer_result_t = typename prefer_result::type;
} // namespace asio
#endif // defined(GENERATING_DOCUMENTATION)
#include "asio/detail/pop_options.hpp"
#endif // ASIO_PREFER_HPP