diff --git a/src/entt/entity/sparse_set.hpp b/src/entt/entity/sparse_set.hpp index b9eb64f20..44acc5df9 100644 --- a/src/entt/entity/sparse_set.hpp +++ b/src/entt/entity/sparse_set.hpp @@ -306,6 +306,19 @@ public: /*! @brief Reverse iterator type. */ using reverse_iterator = std::reverse_iterator; + /*! @brief Default constructor. */ + basic_sparse_set() + : basic_sparse_set{allocator_type{}} + {} + + /** + * @brief Constructs an empty container with a given allocator. + * @param allocator The allocator to use. + */ + explicit basic_sparse_set(const allocator_type &allocator) + : basic_sparse_set{deletion_policy::swap_and_pop, allocator} + {} + /** * @brief Constructs an empty container with the given policy and allocator. * @param pol Type of deletion policy. @@ -321,14 +334,6 @@ public: mode{pol} {} - /** - * @brief Constructs an empty container with the given allocator. - * @param allocator Allocator to use (possibly default-constructed). - */ - explicit basic_sparse_set(const allocator_type &allocator = {}) - : basic_sparse_set{deletion_policy::swap_and_pop, allocator} - {} - /** * @brief Move constructor. * @param other The instance to move from. diff --git a/src/entt/entity/storage.hpp b/src/entt/entity/storage.hpp index e7117dfaa..3822b2d10 100644 --- a/src/entt/entity/storage.hpp +++ b/src/entt/entity/storage.hpp @@ -324,11 +324,16 @@ public: /*! @brief Constant reverse iterator type. */ using const_reverse_iterator = std::reverse_iterator; + /*! @brief Default constructor. */ + basic_storage() + : basic_storage{allocator_type{}} + {} + /** - * @brief Default constructor. - * @param allocator Allocator to use (possibly default-constructed). + * @brief Constructs an empty storage with a given allocator. + * @param allocator the allocator to use. */ - explicit basic_storage(const allocator_type &allocator = {}) + explicit basic_storage(const allocator_type &allocator) : underlying_type{deletion_policy{comp_traits::in_place_delete::value}, allocator}, bucket{allocator, 0u}, packed{}