Sfoglia il codice sorgente

sparse_set: make capacity virtual

Michele Caini 4 anni fa
parent
commit
15efe9f702
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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

@@ -405,7 +405,7 @@ public:
      * allocated space for.
      * @return Capacity of the sparse set.
      */
-    [[nodiscard]] size_type capacity() const ENTT_NOEXCEPT {
+    [[nodiscard]] virtual size_type capacity() const ENTT_NOEXCEPT {
         return reserved.second();
     }
 

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

@@ -415,7 +415,7 @@ public:
      * allocated space for.
      * @return Capacity of the storage.
      */
-    [[nodiscard]] size_type capacity() const ENTT_NOEXCEPT {
+    [[nodiscard]] size_type capacity() const ENTT_NOEXCEPT override {
         return bucket.second() * packed_page;
     }