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