*: get around the fact that msvc also accepts invalid code O.o

This commit is contained in:
Michele Caini
2021-08-21 17:28:30 +02:00
parent 6f546ffe95
commit 38f655e7b8
2 changed files with 3 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ constexpr void propagate_on_container_move_assignment([[maybe_unused]] Allocator
*/
template<typename Allocator>
constexpr void propagate_on_container_swap(Allocator &lhs, Allocator &rhs) ENTT_NOEXCEPT {
static constexpr auto pocs = std::allocator_traits<Allocator>::propagate_on_container_swap::value;
constexpr auto pocs = std::allocator_traits<Allocator>::propagate_on_container_swap::value;
ENTT_ASSERT(pocs || lhs == rhs, "Cannot swap the containers");
if constexpr(pocs) {

View File

@@ -352,7 +352,7 @@ public:
free_list{std::exchange(other.free_list, tombstone)},
mode{other.mode}
{
ENTT_ASSERT(alloc_traits::is_always_equal{} || reserved.first() == other.reserved.first(), "Copying a sparse set is not allowed");
ENTT_ASSERT(alloc_traits::is_always_equal::value || reserved.first() == other.reserved.first(), "Copying a sparse set is not allowed");
}
/*! @brief Default destructor. */
@@ -368,7 +368,7 @@ public:
basic_sparse_set & operator=(basic_sparse_set &&other) ENTT_NOEXCEPT {
release_memory();
propagate_on_container_move_assignment(reserved.first(), other.reserved.first());
ENTT_ASSERT(alloc_traits::is_always_equal{} || reserved.first() == other.reserved.first(), "Copying a sparse set is not allowed");
ENTT_ASSERT(alloc_traits::is_always_equal::value || reserved.first() == other.reserved.first(), "Copying a sparse set is not allowed");
reserved.second() = std::exchange(other.reserved.second(), size_type{});
sparse_array = std::exchange(other.sparse_array, alloc_ptr_pointer{});
packed_array = std::exchange(other.packed_array, alloc_pointer{});