Jelajahi Sumber

dense set: suppress conversion warning

skypjack 3 bulan lalu
induk
melakukan
f6a3b09ec2
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      src/entt/container/dense_set.hpp

+ 2 - 2
src/entt/container/dense_set.hpp

@@ -237,7 +237,7 @@ class dense_set {
     [[nodiscard]] auto constrained_find(const Other &value, const std::size_t bucket) {
     [[nodiscard]] auto constrained_find(const Other &value, const std::size_t bucket) {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].first) {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].first) {
             if(packed.second()(packed.first()[offset].second, value)) {
             if(packed.second()(packed.first()[offset].second, value)) {
-                return begin() + offset;
+                return begin() + static_cast<typename iterator::difference_type>(offset);
             }
             }
         }
         }
 
 
@@ -248,7 +248,7 @@ class dense_set {
     [[nodiscard]] auto constrained_find(const Other &value, const std::size_t bucket) const {
     [[nodiscard]] auto constrained_find(const Other &value, const std::size_t bucket) const {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].first) {
         for(auto offset = sparse.first()[bucket]; offset != placeholder_position; offset = packed.first()[offset].first) {
             if(packed.second()(packed.first()[offset].second, value)) {
             if(packed.second()(packed.first()[offset].second, value)) {
-                return cbegin() + offset;
+                return cbegin() + static_cast<typename const_iterator::difference_type>(offset);
             }
             }
         }
         }