diff --git a/TODO b/TODO index 97c112f53..0e5d46d49 100644 --- a/TODO +++ b/TODO @@ -28,8 +28,7 @@ Next: - meta: update doc - static constexpr -> inline constexpr - remove internal::find_if - - use a dedicate class template to specialize meta views for a better support to customizations - add const meta container support to meta any - meta_any deref fails if operator* returns a temporary - - remove container detector from type traits (is broken) - remove dereferenceable detector from type traits (is broken) + - update meta.md diff --git a/src/entt/core/type_traits.hpp b/src/entt/core/type_traits.hpp index d8059621d..b65bb93c7 100644 --- a/src/entt/core/type_traits.hpp +++ b/src/entt/core/type_traits.hpp @@ -206,126 +206,6 @@ template inline constexpr auto is_equality_comparable_v = is_equality_comparable::value; -/** - * @brief Provides the member constant `value` to true if a given type is a - * container, false otherwise. - * @tparam Type Potentially container type. - */ -template -struct is_container: std::false_type {}; - - -/*! @copydoc is_container */ -template -struct is_container()), end(std::declval()))>> - : std::true_type -{}; - - -/** - * @brief Helper variable template. - * @tparam Type Potentially container type. - */ -template -inline constexpr auto is_container_v = is_container::value; - - -/** - * @brief Provides the member constant `value` to true if a given type is an - * associative container, false otherwise. - * @tparam Type Potentially associative container type. - */ -template -struct is_associative_container: std::false_type {}; - - -/*! @copydoc is_associative_container */ -template -struct is_associative_container> - : is_container -{}; - - -/** - * @brief Helper variable template. - * @tparam Type Potentially associative container type. - */ -template -inline constexpr auto is_associative_container_v = is_associative_container::value; - - -/** - * @brief Provides the member constant `value` to true if a given type is a - * key-only associative container, false otherwise. - * @tparam Type Potentially key-only associative container type. - */ -template -struct is_key_only_associative_container: std::false_type {}; - - -/*! @copydoc is_associative_container */ -template -struct is_key_only_associative_container>> - : is_associative_container -{}; - - -/** - * @brief Helper variable template. - * @tparam Type Potentially key-only associative container type. - */ -template -inline constexpr auto is_key_only_associative_container_v = is_key_only_associative_container::value; - - -/** - * @brief Provides the member constant `value` to true if a given type is a - * sequence container, false otherwise. - * @tparam Type Potentially sequence container type. - */ -template -struct is_sequence_container: std::false_type {}; - - -/*! @copydoc is_sequence_container */ -template -struct is_sequence_container>> - : is_container -{}; - - -/** - * @brief Helper variable template. - * @tparam Type Potentially sequence container type. - */ -template -inline constexpr auto is_sequence_container_v = is_sequence_container::value; - - -/** - * @brief Provides the member constant `value` to true if a given type is a - * dynamic sequence container, false otherwise. - * @tparam Type Potentially dynamic sequence container type. - */ -template -struct is_dynamic_sequence_container: std::false_type {}; - - -/*! @copydoc is_dynamic_sequence_container */ -template -struct is_dynamic_sequence_container().insert({}, std::declval()))>> - : is_sequence_container -{}; - - -/** - * @brief Helper variable template. - * @tparam Type Potentially dynamic sequence container type. - */ -template -inline constexpr auto is_dynamic_sequence_container_v = is_dynamic_sequence_container::value; - - /** * @brief Provides the member constant `value` to true if a given type is * dereferenceable, false otherwise. diff --git a/test/entt/core/type_traits.cpp b/test/entt/core/type_traits.cpp index 94099affc..7570a2f68 100644 --- a/test/entt/core/type_traits.cpp +++ b/test/entt/core/type_traits.cpp @@ -52,32 +52,6 @@ TEST(TypeTraits, IsEqualityComparable) { ASSERT_FALSE(entt::is_equality_comparable_v); } -TEST(TypeTraits, IsContainer) { - ASSERT_TRUE(entt::is_container_v>); - ASSERT_FALSE(entt::is_associative_container_v>); - ASSERT_FALSE(entt::is_key_only_associative_container_v>); - ASSERT_TRUE(entt::is_sequence_container_v>); - ASSERT_TRUE(entt::is_dynamic_sequence_container_v>); - - ASSERT_TRUE((entt::is_container_v>)); - ASSERT_FALSE((entt::is_associative_container_v>)); - ASSERT_FALSE((entt::is_key_only_associative_container_v>)); - ASSERT_TRUE((entt::is_sequence_container_v>)); - ASSERT_FALSE((entt::is_dynamic_sequence_container_v>)); - - ASSERT_TRUE((entt::is_container_v>)); - ASSERT_TRUE((entt::is_associative_container_v>)); - ASSERT_FALSE((entt::is_key_only_associative_container_v>)); - ASSERT_FALSE((entt::is_sequence_container_v>)); - ASSERT_FALSE((entt::is_dynamic_sequence_container_v>)); - - ASSERT_TRUE(entt::is_container_v>); - ASSERT_TRUE(entt::is_associative_container_v>); - ASSERT_TRUE(entt::is_key_only_associative_container_v>); - ASSERT_FALSE(entt::is_sequence_container_v>); - ASSERT_FALSE(entt::is_dynamic_sequence_container_v>); -} - TEST(TypeTraits, IsDereferenceable) { ASSERT_TRUE(entt::is_dereferenceable_v); ASSERT_TRUE(entt::is_dereferenceable_v>);