diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index 8f78ee5cb..836fcf049 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -229,10 +229,8 @@ class dense_set { static constexpr float default_threshold = 0.875f; static constexpr std::size_t minimum_capacity = 8u; - using alloc_traits = std::allocator_traits; - static_assert(std::is_same_v); - using node_type = std::pair; + using alloc_traits = std::allocator_traits; using sparse_container_type = std::vector>; using packed_container_type = std::vector>; @@ -278,13 +276,10 @@ class dense_set { void move_and_pop(const std::size_t pos) { if(const auto last = size() - 1u; pos != last) { + packed.first()[pos] = std::move(packed.first().back()); size_type *curr = sparse.first().data() + bucket(packed.first().back().second); for(; *curr != last; curr = &packed.first()[*curr].first) {} *curr = pos; - - // basic exception guarantees when value type has a throwing move constructor - packed.first()[pos].second = std::move(packed.first().back().second); - packed.first()[pos].first = packed.first().back().first; } packed.first().pop_back();