Michele Caini 4 лет назад
Родитель
Сommit
75d4bc7c18
2 измененных файлов с 26 добавлено и 20 удалено
  1. 6 16
      src/entt/entity/sparse_set.hpp
  2. 20 4
      src/entt/entity/storage.hpp

+ 6 - 16
src/entt/entity/sparse_set.hpp

@@ -244,26 +244,17 @@ class basic_sparse_set {
     }
 
 protected:
-    /**
-     * @brief Swaps two entities in the internal packed array.
-     * @param lhs A valid position of an entity within storage.
-     * @param rhs A valid position of an entity within storage.
-     */
-    virtual void swap_at([[maybe_unused]] const std::size_t lhs, [[maybe_unused]] const std::size_t rhs) {}
+    /*! @brief Swaps two entities in the internal packed array. */
+    virtual void swap_at(const std::size_t, const std::size_t) {}
 
-    /**
-     * @brief Moves an entity in the internal packed array.
-     * @param from A valid position of an entity within storage.
-     * @param to A valid position of an entity within storage.
-     */
-    virtual void move_and_pop([[maybe_unused]] const std::size_t from, [[maybe_unused]] const std::size_t to) {}
+    /*! @brief Moves an entity in the internal packed array. */
+    virtual void move_and_pop(const std::size_t, const std::size_t) {}
 
     /**
      * @brief Attempts to erase an entity from the internal packed array.
      * @param entt A valid entity identifier.
-     * @param ud Optional user data that are forwarded as-is to derived classes.
      */
-    virtual void swap_and_pop(const Entity entt, [[maybe_unused]] void *ud) {
+    virtual void swap_and_pop(const Entity entt, void *) {
         auto &ref = sparse[page(entt)][offset(entt)];
         const auto pos = static_cast<size_type>(entity_traits::to_entity(ref));
         ENTT_ASSERT(packed[pos] == entt, "Invalid entity identifier");
@@ -280,9 +271,8 @@ protected:
     /**
      * @brief Attempts to erase an entity from the internal packed array.
      * @param entt A valid entity identifier.
-     * @param ud Optional user data that are forwarded as-is to derived classes.
      */
-    virtual void in_place_pop(const Entity entt, [[maybe_unused]] void *ud) {
+    virtual void in_place_pop(const Entity entt, void *) {
         auto &ref = sparse[page(entt)][offset(entt)];
         const auto pos = static_cast<size_type>(entity_traits::to_entity(ref));
         ENTT_ASSERT(packed[pos] == entt, "Invalid entity identifier");

+ 20 - 4
src/entt/entity/storage.hpp

@@ -269,18 +269,30 @@ class basic_storage: public basic_sparse_set<Entity, typename std::allocator_tra
     }
 
 protected:
-    /*! @copydoc basic_sparse_set::swap_at */
+    /**
+     * @brief Swaps two entities in the internal packed array.
+     * @param lhs A valid position of an entity within storage.
+     * @param rhs A valid position of an entity within storage.
+     */
     void swap_at(const std::size_t lhs, const std::size_t rhs) final {
         std::swap(packed[page(lhs)][offset(lhs)], packed[page(rhs)][offset(rhs)]);
     }
 
-    /*! @copydoc basic_sparse_set::move_and_pop */
+    /**
+     * @brief Moves an entity in the internal packed array.
+     * @param from A valid position of an entity within storage.
+     * @param to A valid position of an entity within storage.
+     */
     void move_and_pop(const std::size_t from, const std::size_t to) final {
         push_at(to, std::move(packed[page(from)][offset(from)]));
         pop_at(from);
     }
 
-    /*! @copydoc basic_sparse_set::swap_and_pop */
+    /**
+     * @brief Attempts to erase an entity from the internal packed array.
+     * @param entt A valid entity identifier.
+     * @param ud Optional user data that are forwarded as-is to derived classes.
+     */
     void swap_and_pop(const Entity entt, void *ud) override {
         const auto pos = underlying_type::index(entt);
         const auto last = underlying_type::size() - 1u;
@@ -294,7 +306,11 @@ protected:
         underlying_type::swap_and_pop(entt, ud);
     }
 
-    /*! @copydoc basic_sparse_set::in_place_pop */
+    /**
+     * @brief Attempts to erase an entity from the internal packed array.
+     * @param entt A valid entity identifier.
+     * @param ud Optional user data that are forwarded as-is to derived classes.
+     */
     void in_place_pop(const Entity entt, void *ud) override {
         const auto pos = underlying_type::index(entt);
         underlying_type::in_place_pop(entt, ud);