skypjack 19 часов назад
Родитель
Сommit
15f4e28205

+ 3 - 3
src/entt/core/any.hpp

@@ -88,7 +88,7 @@ class basic_any: private internal::basic_any_storage<Len, Align> {
             }
             break;
         case compare:
-            if constexpr(!stl::is_function_v<Type> && !std::is_array_v<Type> && is_equality_comparable_v<Type>) {
+            if constexpr(!stl::is_function_v<Type> && !stl::is_array_v<Type> && is_equality_comparable_v<Type>) {
                 return (*elem == *static_cast<const Type *>(other)) ? other : nullptr;
             } else {
                 return (elem == other) ? other : nullptr;
@@ -118,7 +118,7 @@ class basic_any: private internal::basic_any_storage<Len, Align> {
 
         if constexpr(in_situ_v<Type>) {
             (value.mode == any_policy::embedded) ? elem->~Type() : (delete elem);
-        } else if constexpr(std::is_array_v<Type>) {
+        } else if constexpr(stl::is_array_v<Type>) {
             delete[] elem;
         } else {
             delete elem;
@@ -163,7 +163,7 @@ class basic_any: private internal::basic_any_storage<Len, Align> {
 
             if constexpr(stl::is_aggregate_v<plain_type> && (sizeof...(Args) != 0u || !stl::is_default_constructible_v<plain_type>)) {
                 this->instance = new plain_type{stl::forward<Args>(args)...};
-            } else if constexpr(std::is_array_v<plain_type>) {
+            } else if constexpr(stl::is_array_v<plain_type>) {
                 static_assert(sizeof...(Args) == 0u, "Invalid arguments");
                 this->instance = new plain_type[std::extent_v<plain_type>]();
             } else {

+ 1 - 1
src/entt/core/memory.hpp

@@ -93,7 +93,7 @@ struct allocation_deleter: private Allocator {
  */
 template<typename Type, typename Allocator, typename... Args>
 constexpr auto allocate_unique(Allocator &allocator, Args &&...args) {
-    static_assert(!std::is_array_v<Type>, "Array types are not supported");
+    static_assert(!stl::is_array_v<Type>, "Array types are not supported");
 
     using alloc_traits = std::allocator_traits<Allocator>::template rebind_traits<Type>;
     using allocator_type = alloc_traits::allocator_type;

+ 1 - 1
src/entt/core/type_traits.hpp

@@ -757,7 +757,7 @@ template<typename Type>
 template<typename Type>
 [[nodiscard]] ENTT_CONSTEVAL bool dispatch_is_equality_comparable() {
     // NOLINTBEGIN(modernize-use-transparent-functors)
-    if constexpr(std::is_array_v<Type>) {
+    if constexpr(stl::is_array_v<Type>) {
         return false;
     } else if constexpr(is_complete_v<stl::tuple_size<stl::remove_const_t<Type>>>) {
         if constexpr(has_tuple_size_value<Type>::value) {

+ 1 - 1
src/entt/meta/meta.hpp

@@ -200,7 +200,7 @@ class meta_any {
                     if(const auto &elem = any_cast<const Type &>(value.storage); elem) {
                         return (value.storage.policy() == any_policy::cref) ? static_cast<meta_any *>(other)->emplace<decltype(*elem)>(*elem) : static_cast<meta_any *>(other)->emplace<decltype(*const_cast<Type &>(elem))>(*const_cast<Type &>(elem));
                     }
-                } else if constexpr(!std::is_array_v<Type> && !stl::is_void_v<stl::remove_const_t<stl::remove_pointer_t<Type>>>) {
+                } else if constexpr(!stl::is_array_v<Type> && !stl::is_void_v<stl::remove_const_t<stl::remove_pointer_t<Type>>>) {
                     if(auto *pointer = any_cast<Type>(value.storage); pointer) {
                         static_cast<meta_any *>(other)->emplace<std::conditional_t<stl::is_function_v<stl::remove_const_t<stl::remove_pointer_t<Type>>>, Type, stl::remove_pointer_t<Type> &>>(*pointer);
                     }

+ 1 - 1
src/entt/meta/node.hpp

@@ -218,7 +218,7 @@ auto setup_node_for() noexcept {
         (std::is_arithmetic_v<Type> ? meta_traits::is_arithmetic : meta_traits::is_none)
             | (std::is_integral_v<Type> ? meta_traits::is_integral : meta_traits::is_none)
             | (std::is_signed_v<Type> ? meta_traits::is_signed : meta_traits::is_none)
-            | (std::is_array_v<Type> ? meta_traits::is_array : meta_traits::is_none)
+            | (stl::is_array_v<Type> ? meta_traits::is_array : meta_traits::is_none)
             | (std::is_enum_v<Type> ? meta_traits::is_enum : meta_traits::is_none)
             | (std::is_class_v<Type> ? meta_traits::is_class : meta_traits::is_none)
             | (stl::is_pointer_v<Type> ? meta_traits::is_pointer : meta_traits::is_none)

+ 4 - 4
src/entt/meta/utility.hpp

@@ -286,7 +286,7 @@ template<typename Type, auto Data>
     } else if constexpr(stl::is_member_object_pointer_v<decltype(Data)>) {
         using data_type = stl::remove_reference_t<typename meta_function_helper_t<Type, decltype(Data)>::return_type>;
 
-        if constexpr(!std::is_array_v<data_type> && !stl::is_const_v<data_type>) {
+        if constexpr(!stl::is_array_v<data_type> && !stl::is_const_v<data_type>) {
             if(auto *const clazz = instance->try_cast<Type>(); clazz && value.allow_cast<data_type>()) {
                 std::invoke(Data, *clazz) = value.cast<data_type>();
                 return true;
@@ -295,7 +295,7 @@ template<typename Type, auto Data>
     } else if constexpr(stl::is_pointer_v<decltype(Data)>) {
         using data_type = stl::remove_reference_t<decltype(*Data)>;
 
-        if constexpr(!std::is_array_v<data_type> && !stl::is_const_v<data_type>) {
+        if constexpr(!stl::is_array_v<data_type> && !stl::is_const_v<data_type>) {
             if(value.allow_cast<data_type>()) {
                 *Data = value.cast<data_type>();
                 return true;
@@ -317,7 +317,7 @@ template<typename Type, auto Data>
 template<typename Type, auto Data, meta_policy Policy = as_value_t>
 [[nodiscard]] meta_any meta_getter(meta_handle instance) {
     if constexpr(std::is_member_pointer_v<decltype(Data)> || stl::is_function_v<stl::remove_reference_t<stl::remove_pointer_t<decltype(Data)>>>) {
-        if constexpr(!std::is_array_v<stl::remove_cvref_t<stl::invoke_result_t<decltype(Data), Type &>>>) {
+        if constexpr(!stl::is_array_v<stl::remove_cvref_t<stl::invoke_result_t<decltype(Data), Type &>>>) {
             if constexpr(std::is_invocable_v<decltype(Data), Type &>) {
                 if(auto *clazz = instance->try_cast<Type>(); clazz) {
                     return meta_dispatch<Policy>(instance->context(), std::invoke(Data, *clazz));
@@ -333,7 +333,7 @@ template<typename Type, auto Data, meta_policy Policy = as_value_t>
 
         return meta_any{meta_ctx_arg, instance->context()};
     } else if constexpr(stl::is_pointer_v<decltype(Data)>) {
-        if constexpr(std::is_array_v<stl::remove_pointer_t<decltype(Data)>>) {
+        if constexpr(stl::is_array_v<stl::remove_pointer_t<decltype(Data)>>) {
             return meta_any{meta_ctx_arg, instance->context()};
         } else {
             return meta_dispatch<Policy>(instance->context(), *Data);

+ 1 - 0
src/entt/stl/type_traits.hpp

@@ -10,6 +10,7 @@ using std::decay_t;
 using std::false_type;
 using std::invoke_result_t;
 using std::is_aggregate_v;
+using std::is_array_v;
 using std::is_const_v;
 using std::is_copy_assignable_v;
 using std::is_copy_constructible_v;