diff options
| author | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
| commit | 61e5bcef2629e2d68b805a956a96fff264d4f74d (patch) | |
| tree | bca3a94bac79d34e3c0db57c77604f5a823ecbda /deps/include/entt/core/utility.hpp | |
| parent | 88c01588aa0830e219eaa62588839e4d1e2883ce (diff) | |
| download | voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.tar.bz2 voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.zip | |
Restructure dependencies and update to C++20
- Nuked static_assert from almost everywhere in the project
- Nuked binary dependency support. Might add one later though
- Separated dependency headers into a separate include subdirectory
- Grafted a thirdpartylegalnotices.txt generator from RITEG
- Pushed development snapshot version to 2126 (26th week of 2025)
Diffstat (limited to 'deps/include/entt/core/utility.hpp')
| -rw-r--r-- | deps/include/entt/core/utility.hpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/deps/include/entt/core/utility.hpp b/deps/include/entt/core/utility.hpp deleted file mode 100644 index ddab926..0000000 --- a/deps/include/entt/core/utility.hpp +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef ENTT_CORE_UTILITY_HPP
-#define ENTT_CORE_UTILITY_HPP
-
-#include <type_traits>
-#include <utility>
-
-namespace entt {
-
-/*! @brief Identity function object (waiting for C++20). */
-struct identity {
- /*! @brief Indicates that this is a transparent function object. */
- using is_transparent = void;
-
- /**
- * @brief Returns its argument unchanged.
- * @tparam Type Type of the argument.
- * @param value The actual argument.
- * @return The submitted value as-is.
- */
- template<typename Type>
- [[nodiscard]] constexpr Type &&operator()(Type &&value) const noexcept {
- return std::forward<Type>(value);
- }
-};
-
-/**
- * @brief Constant utility to disambiguate overloaded members of a class.
- * @tparam Type Type of the desired overload.
- * @tparam Class Type of class to which the member belongs.
- * @param member A valid pointer to a member.
- * @return Pointer to the member.
- */
-template<typename Type, typename Class>
-[[nodiscard]] constexpr auto overload(Type Class::*member) noexcept {
- return member;
-}
-
-/**
- * @brief Constant utility to disambiguate overloaded functions.
- * @tparam Func Function type of the desired overload.
- * @param func A valid pointer to a function.
- * @return Pointer to the function.
- */
-template<typename Func>
-[[nodiscard]] constexpr auto overload(Func *func) noexcept {
- return func;
-}
-
-/**
- * @brief Helper type for visitors.
- * @tparam Func Types of function objects.
- */
-template<typename... Func>
-struct overloaded: Func... {
- using Func::operator()...;
-};
-
-/**
- * @brief Deduction guide.
- * @tparam Func Types of function objects.
- */
-template<typename... Func>
-overloaded(Func...) -> overloaded<Func...>;
-
-/**
- * @brief Basic implementation of a y-combinator.
- * @tparam Func Type of a potentially recursive function.
- */
-template<typename Func>
-struct y_combinator {
- /**
- * @brief Constructs a y-combinator from a given function.
- * @param recursive A potentially recursive function.
- */
- constexpr y_combinator(Func recursive) noexcept(std::is_nothrow_move_constructible_v<Func>)
- : func{std::move(recursive)} {}
-
- /**
- * @brief Invokes a y-combinator and therefore its underlying function.
- * @tparam Args Types of arguments to use to invoke the underlying function.
- * @param args Parameters to use to invoke the underlying function.
- * @return Return value of the underlying function, if any.
- */
- template<typename... Args>
- constexpr decltype(auto) operator()(Args &&...args) const noexcept(std::is_nothrow_invocable_v<Func, const y_combinator &, Args...>) {
- return func(*this, std::forward<Args>(args)...);
- }
-
- /*! @copydoc operator()() */
- template<typename... Args>
- constexpr decltype(auto) operator()(Args &&...args) noexcept(std::is_nothrow_invocable_v<Func, y_combinator &, Args...>) {
- return func(*this, std::forward<Args>(args)...);
- }
-
-private:
- Func func;
-};
-
-} // namespace entt
-
-#endif
|
