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

container: handle conversion warnings

Michele Caini 1 год назад
Родитель
Сommit
ccb63bfd80
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      src/entt/container/dense_map.hpp
  2. 1 1
      src/entt/container/table.hpp

+ 1 - 1
src/entt/container/dense_map.hpp

@@ -288,7 +288,7 @@ class dense_map {
     [[nodiscard]] auto constrained_find(const Other &key, std::size_t bucket) const {
         for(auto it = cbegin(bucket), last = cend(bucket); it != last; ++it) {
             if(packed.second()(it->first, key)) {
-                return cbegin() + static_cast<typename iterator::difference_type>(it.index());
+                return cbegin() + static_cast<typename const_iterator::difference_type>(it.index());
             }
         }
 

+ 1 - 1
src/entt/container/table.hpp

@@ -417,7 +417,7 @@ public:
      */
     void erase(const size_type pos) {
         ENTT_ASSERT(pos < size(), "Index out of bounds");
-        erase(begin() + static_cast<typename const_iterator::difference_type>(pos));
+        erase(begin() + static_cast<typename iterator::difference_type>(pos));
     }
 
     /**