core: drop entt::identity
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user