Преглед на файлове

storage: handle conversion warnings

Michele Caini преди 1 година
родител
ревизия
3ef946802b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/entt/entity/storage.hpp

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

@@ -89,7 +89,7 @@ public:
     }
 
     [[nodiscard]] constexpr reference operator[](const difference_type value) const noexcept {
-        const auto pos = index() - value;
+        const auto pos = static_cast<typename Container::size_type>(index() - value);
         constexpr auto page_size = component_traits<value_type>::page_size;
         return (*payload)[pos / page_size][fast_mod(static_cast<std::size_t>(pos), page_size)];
     }