Selaa lähdekoodia

core: drop entt::identity

skypjack 3 kuukautta sitten
vanhempi
commit
13395a88f1
2 muutettua tiedostoa jossa 0 lisäystä ja 26 poistoa
  1. 0 17
      src/entt/core/utility.hpp
  2. 0 9
      test/entt/core/utility.cpp

+ 0 - 17
src/entt/core/utility.hpp

@@ -6,23 +6,6 @@
 
 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.

+ 0 - 9
test/entt/core/utility.cpp

@@ -11,15 +11,6 @@ struct functions {
     void bar() {}
 };
 
-TEST(Identity, Functionalities) {
-    const entt::identity identity;
-    int value = 2;
-
-    ASSERT_TRUE(entt::is_transparent_v<entt::identity>);
-    ASSERT_EQ(identity(value), value);
-    ASSERT_EQ(&identity(value), &value);
-}
-
 TEST(Overload, Functionalities) {
     ASSERT_EQ(entt::overload<void(int)>(&functions::foo), static_cast<void (*)(int)>(&functions::foo));
     ASSERT_EQ(entt::overload<void()>(&functions::foo), static_cast<void (*)()>(&functions::foo));