1
0
Эх сурвалжийг харах

sparse_set/storage: swap_at and swap_and_pop are protected and non-final

Michele Caini 5 жил өмнө
parent
commit
ea1f010b1a

+ 1 - 0
src/entt/entity/sparse_set.hpp

@@ -173,6 +173,7 @@ class basic_sparse_set {
         return sparse[pos];
     }
 
+protected:
     virtual void swap_at(const std::size_t, const std::size_t) {}
     virtual void swap_and_pop(const std::size_t) {}
 

+ 3 - 2
src/entt/entity/storage.hpp

@@ -164,11 +164,12 @@ class basic_storage: public basic_sparse_set<Entity> {
         index_type index;
     };
 
-    void swap_at(const std::size_t lhs, const std::size_t rhs) final {
+protected:
+    void swap_at(const std::size_t lhs, const std::size_t rhs) {
         std::swap(instances[lhs], instances[rhs]);
     }
 
-    void swap_and_pop(const std::size_t pos) final {
+    void swap_and_pop(const std::size_t pos) {
         auto other = std::move(instances.back());
         instances[pos] = std::move(other);
         instances.pop_back();