1 #ifndef ENTT_CORE_UTILITY_HPP
2 #define ENTT_CORE_UTILITY_HPP
5 #include "../config/config.h"
21 [[nodiscard]] constexpr Type &&
operator()(Type &&value)
const ENTT_NOEXCEPT {
22 return std::forward<Type>(value);
33 template<
typename Type,
typename Class>
34 [[nodiscard]] constexpr
auto overload(Type Class::*member) ENTT_NOEXCEPT {
44 template<
typename Func>
45 [[nodiscard]] constexpr
auto overload(Func *func) ENTT_NOEXCEPT {
53 template<
class... Func>
55 using Func::operator()...;
62 template<
class... Func>
76 : func{std::move(recursive)} {}
84 template<
class... Args>
85 decltype(
auto) operator()(Args &&...args)
const {
86 return func(*
this, std::forward<Args>(args)...);
90 template<
class... Args>
91 decltype(
auto) operator()(Args &&...args) {
92 return func(*
this, std::forward<Args>(args)...);
overloaded(Func...) -> overloaded< Func... >
Deduction guide.
constexpr auto overload(Type Class::*member)
Constant utility to disambiguate overloaded members of a class.
Identity function object (waiting for C++20).
void is_transparent
Indicates that this is a transparent function object.
constexpr Type && operator()(Type &&value) const
Returns its argument unchanged.
Helper type for visitors.
Basic implementation of a y-combinator.
y_combinator(Func recursive)
Constructs a y-combinator from a given function.