meta: removed meta_type::is_union (no alternative provided)

This commit is contained in:
Michele Caini
2021-08-06 12:07:09 +02:00
parent b24fe2f122
commit adec4f08c6
3 changed files with 1 additions and 19 deletions

View File

@@ -1131,14 +1131,6 @@ public:
return !!(node->traits & internal::meta_traits::IS_ENUM);
}
/**
* @brief Checks whether a type refers to an union or not.
* @return True if the underlying type is an union, false otherwise.
*/
[[nodiscard]] bool is_union() const ENTT_NOEXCEPT {
return !!(node->traits & internal::meta_traits::IS_UNION);
}
/**
* @brief Checks whether a type refers to a class or not.
* @return True if the underlying type is a class, false otherwise.

View File

@@ -39,7 +39,6 @@ enum class meta_traits: std::uint32_t {
IS_FLOATING_POINT = 0x0008,
IS_ARRAY = 0x0010,
IS_ENUM = 0x0020,
IS_UNION = 0x0040,
IS_CLASS = 0x0080,
IS_POINTER = 0x0100,
IS_MEMBER_OBJECT_POINTER = 0x0200,
@@ -189,7 +188,6 @@ public:
| (std::is_floating_point_v<Type> ? internal::meta_traits::IS_FLOATING_POINT : internal::meta_traits::IS_NONE)
| (std::is_array_v<Type> ? internal::meta_traits::IS_ARRAY : internal::meta_traits::IS_NONE)
| (std::is_enum_v<Type> ? internal::meta_traits::IS_ENUM : internal::meta_traits::IS_NONE)
| (std::is_union_v<Type> ? internal::meta_traits::IS_UNION : internal::meta_traits::IS_NONE)
| (std::is_class_v<Type> ? internal::meta_traits::IS_CLASS : internal::meta_traits::IS_NONE)
| (std::is_pointer_v<Type> ? internal::meta_traits::IS_POINTER : internal::meta_traits::IS_NONE)
| (std::is_member_object_pointer_v<Type> ? internal::meta_traits::IS_MEMBER_OBJECT_POINTER : internal::meta_traits::IS_NONE)

View File

@@ -87,11 +87,6 @@ enum class property_t {
list
};
union union_t {
int i;
double d;
};
struct MetaType: ::testing::Test {
void SetUp() override {
using namespace entt::literals;
@@ -229,11 +224,8 @@ TEST_F(MetaType, Traits) {
ASSERT_TRUE(entt::resolve<property_t>().is_enum());
ASSERT_FALSE(entt::resolve<char>().is_enum());
ASSERT_TRUE(entt::resolve<union_t>().is_union());
ASSERT_FALSE(entt::resolve<derived_t>().is_union());
ASSERT_TRUE(entt::resolve<derived_t>().is_class());
ASSERT_FALSE(entt::resolve<union_t>().is_class());
ASSERT_FALSE(entt::resolve<double>().is_class());
ASSERT_TRUE(entt::resolve<int *>().is_pointer());
ASSERT_FALSE(entt::resolve<int>().is_pointer());