Browse Source

fixed constness of iterators' member functions

Michele Caini 7 years ago
parent
commit
05db0aad29
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/entt/entity/sparse_set.hpp
  2. 1 1
      src/entt/entity/view.hpp

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

@@ -84,7 +84,7 @@ class SparseSet<Entity> {
             return *this;
             return *this;
         }
         }
 
 
-        Iterator operator+(difference_type value) ENTT_NOEXCEPT {
+        Iterator operator+(difference_type value) const ENTT_NOEXCEPT {
             return Iterator{direct, pos-value};
             return Iterator{direct, pos-value};
         }
         }
 
 
@@ -527,7 +527,7 @@ class SparseSet<Entity, Type>: public SparseSet<Entity> {
             return *this;
             return *this;
         }
         }
 
 
-        Iterator operator+(difference_type value) ENTT_NOEXCEPT {
+        Iterator operator+(difference_type value) const ENTT_NOEXCEPT {
             return Iterator{instances, pos-value};
             return Iterator{instances, pos-value};
         }
         }
 
 

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

@@ -508,7 +508,7 @@ class View final {
             return ((begin += value) != end && !valid()) ? ++(*this) : *this;
             return ((begin += value) != end && !valid()) ? ++(*this) : *this;
         }
         }
 
 
-        Iterator operator+(difference_type value) ENTT_NOEXCEPT {
+        Iterator operator+(difference_type value) const ENTT_NOEXCEPT {
             return Iterator{unchecked, extent, begin+value, end};
             return Iterator{unchecked, extent, begin+value, end};
         }
         }