>().require(static_cast(p))
)
)
-> decltype(
declval>().require(static_cast(p))
);
};
#else // defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
typedef T type;
#endif // defined(ASIO_HAS_DEDUCED_REQUIRE_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_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_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 == 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_require_fn
namespace asio {
namespace {
static constexpr const asio_require_fn::impl&
require = asio_require_fn::static_instance<>::instance;
} // namespace
typedef asio_require_fn::impl require_t;
template
struct can_require :
integral_constant::overload
!= asio_require_fn::ill_formed>
{
};
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
constexpr bool can_require_v
= can_require::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
struct is_nothrow_require :
integral_constant::is_noexcept>
{
};
#if defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
constexpr bool is_nothrow_require_v
= is_nothrow_require::value;
#endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
template
struct require_result
{
typedef typename asio_require_fn::call_traits<
require_t, T, void(Properties...)>::result_type type;
};
template
using require_result_t = typename require_result::type;
} // namespace asio
#endif // defined(GENERATING_DOCUMENTATION)
#include "asio/detail/pop_options.hpp"
#endif // ASIO_REQUIRE_HPP