Răsfoiți Sursa

*: minor changes

Michele Caini 3 ani în urmă
părinte
comite
e2e8a575c6
3 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 1 1
      src/entt/core/memory.hpp
  2. 1 1
      src/entt/entity/component.hpp
  3. 1 1
      src/entt/entity/helper.hpp

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

@@ -19,7 +19,7 @@ namespace entt {
  */
  */
 template<typename Type>
 template<typename Type>
 [[nodiscard]] constexpr auto to_address(Type &&ptr) noexcept {
 [[nodiscard]] constexpr auto to_address(Type &&ptr) noexcept {
-    if constexpr(std::is_pointer_v<std::remove_cv_t<std::remove_reference_t<Type>>>) {
+    if constexpr(std::is_pointer_v<std::decay_t<Type>>) {
         return ptr;
         return ptr;
     } else {
     } else {
         return to_address(std::forward<Type>(ptr).operator->());
         return to_address(std::forward<Type>(ptr).operator->());

+ 1 - 1
src/entt/entity/component.hpp

@@ -41,7 +41,7 @@ struct page_size<Type, std::enable_if_t<std::is_convertible_v<decltype(Type::pag
  */
  */
 template<typename Type, typename = void>
 template<typename Type, typename = void>
 struct component_traits {
 struct component_traits {
-    static_assert(std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, Type>, "Unsupported type");
+    static_assert(std::is_same_v<std::decay_t<Type>, Type>, "Unsupported type");
 
 
     /*! @brief Component type. */
     /*! @brief Component type. */
     using type = Type;
     using type = Type;

+ 1 - 1
src/entt/entity/helper.hpp

@@ -103,7 +103,7 @@ private:
  * @param reg A registry that contains the given entity and its components.
  * @param reg A registry that contains the given entity and its components.
  * @param entt Entity from which to get the component.
  * @param entt Entity from which to get the component.
  */
  */
-template<auto Member, typename Registry = std::remove_cv_t<std::remove_reference_t<nth_argument_t<0u, Member>>>>
+template<auto Member, typename Registry = std::decay_t<nth_argument_t<0u, Member>>>
 void invoke(Registry &reg, const typename Registry::entity_type entt) {
 void invoke(Registry &reg, const typename Registry::entity_type entt) {
     static_assert(std::is_member_function_pointer_v<decltype(Member)>, "Invalid pointer to non-static member function");
     static_assert(std::is_member_function_pointer_v<decltype(Member)>, "Invalid pointer to non-static member function");
     delegate<void(Registry &, const typename Registry::entity_type)> func;
     delegate<void(Registry &, const typename Registry::entity_type)> func;