Просмотр исходного кода

meta: treat T(*)[N] as non-pointer-like types

Michele Caini 4 лет назад
Родитель
Сommit
e98d8426bb
2 измененных файлов с 11 добавлено и 9 удалено
  1. 11 0
      src/entt/meta/pointer.hpp
  2. 0 9
      src/entt/meta/type_traits.hpp

+ 11 - 0
src/entt/meta/pointer.hpp

@@ -20,6 +20,17 @@ struct is_meta_pointer_like<Type *>
 {};
 
 
+/**
+ * @brief Partial specialization used to reject pointers to arrays.
+ * @tparam Type Type of elements of the array.
+ * @tparam N Number of elements of the array.
+ */
+template<typename Type, std::size_t N>
+struct is_meta_pointer_like<Type(*)[N]>
+    : std::false_type
+{};
+
+
 /**
  * @brief Makes `std::shared_ptr`s of any type pointer-like types for the meta
  * system.

+ 0 - 9
src/entt/meta/type_traits.hpp

@@ -65,15 +65,6 @@ template<typename>
 struct is_meta_pointer_like: std::false_type {};
 
 
-/**
- * @brief Partial specialization to ensure that arrays aren't accepted.
- * @tparam Type Type of elements of the array.
- * @tparam N Number of elements of the array.
- */
-template<typename Type, std::size_t N>
-struct is_meta_pointer_like<Type[N]>: std::false_type {};
-
-
 /**
  * @brief Partial specialization to ensure that const pointer-like types are
  * also accepted.