Browse Source

sparse_set: make shrink_to_fit virtual

Michele Caini 4 years ago
parent
commit
6a2c54adf5
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/entt/entity/sparse_set.hpp
  2. 1 1
      src/entt/entity/storage.hpp

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

@@ -410,7 +410,7 @@ public:
     }
     }
 
 
     /*! @brief Requests the removal of unused capacity. */
     /*! @brief Requests the removal of unused capacity. */
-    void shrink_to_fit() {
+    virtual void shrink_to_fit() {
         if(count < reserved.second()) {
         if(count < reserved.second()) {
             resize_packed(count);
             resize_packed(count);
         }
         }

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

@@ -420,7 +420,7 @@ public:
     }
     }
 
 
     /*! @brief Requests the removal of unused capacity. */
     /*! @brief Requests the removal of unused capacity. */
-    void shrink_to_fit() {
+    void shrink_to_fit() override {
         underlying_type::shrink_to_fit();
         underlying_type::shrink_to_fit();
         release_unused_pages();
         release_unused_pages();
     }
     }