Browse Source

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

Michele Caini 4 years ago
parent
commit
38f655e7b8
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/entt/core/memory.hpp
  2. 2 2
      src/entt/entity/sparse_set.hpp

+ 1 - 1
src/entt/core/memory.hpp

@@ -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) {

+ 2 - 2
src/entt/entity/sparse_set.hpp

@@ -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{});