ソースを参照

handle_storage_iterator: const correctness

Michele Caini 1 年間 前
コミット
bea0418927
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/entt/entity/handle.hpp

+ 2 - 2
src/entt/entity/handle.hpp

@@ -47,12 +47,12 @@ public:
     }
     }
 
 
     constexpr handle_storage_iterator &operator++() noexcept {
     constexpr handle_storage_iterator &operator++() noexcept {
-        while(++it != last && !it->second.contains(entt)) {}
+        for(++it; it != last && !it->second.contains(entt); ++it) {}
         return *this;
         return *this;
     }
     }
 
 
     constexpr handle_storage_iterator operator++(int) noexcept {
     constexpr handle_storage_iterator operator++(int) noexcept {
-        handle_storage_iterator orig = *this;
+        const handle_storage_iterator orig = *this;
         return ++(*this), orig;
         return ++(*this), orig;
     }
     }