>().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_VERSIONED_NAME(prefer_fn)
namespace asio {
ASIO_INLINE_NAMESPACE_BEGIN
namespace {
static constexpr const ASIO_VERSIONED_NAME(prefer_fn)::impl&
prefer = ASIO_VERSIONED_NAME(prefer_fn)::static_instance<>::instance;
} // namespace
typedef ASIO_VERSIONED_NAME(prefer_fn)::impl prefer_t;
template
struct can_prefer :
integral_constant::overload
!= ASIO_VERSIONED_NAME(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_VERSIONED_NAME(prefer_fn)::call_traits<
prefer_t, T, void(Properties...)>::result_type type;
};
template
using prefer_result_t = typename prefer_result::type;
ASIO_INLINE_NAMESPACE_END
} // namespace asio
#endif // defined(GENERATING_DOCUMENTATION)
#include "asio/detail/pop_options.hpp"
#endif // ASIO_PREFER_HPP