diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index 9e8db478a..18ae55b41 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -367,12 +367,18 @@ public: * * @param entt A valid entity identifier. */ - void construct(const entity_type entt) { + void emplace(const entity_type entt) { ENTT_ASSERT(!has(entt)); assure(page(entt))[offset(entt)] = entity_type(direct.size()); direct.push_back(entt); } + /*! @copydoc emplace */ + [[deprecated("use ::emplace instead")]] + void construct(const entity_type entt) { + emplace(entt); + } + /** * @brief Assigns one or more entities to a sparse set. * @@ -387,7 +393,7 @@ public: * @param last An iterator past the last element of the range of entities. */ template - void construct(It first, It last) { + void insert(It first, It last) { std::for_each(first, last, [this, next = direct.size()](const auto entt) mutable { ENTT_ASSERT(!has(entt)); assure(page(entt))[offset(entt)] = entity_type(next++); @@ -396,6 +402,13 @@ public: direct.insert(direct.end(), first, last); } + /*! @copydoc insert */ + template + [[deprecated("use ::insert instead")]] + void construct(It first, It last) { + insert(std::move(first), std::move(last)); + } + /** * @brief Removes an entity from a sparse set. *