Browse Source

sparse_set: suppress a wrong warning by gcc - see #1194

Michele Caini 1 year ago
parent
commit
25dff4bddc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/entt/entity/sparse_set.hpp

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

@@ -166,7 +166,7 @@ class basic_sparse_set {
 
 
     // it could be auto but gcc complains and emits a warning due to a false positive
     // it could be auto but gcc complains and emits a warning due to a false positive
     [[nodiscard]] std::size_t policy_to_head() const noexcept {
     [[nodiscard]] std::size_t policy_to_head() const noexcept {
-        return static_cast<size_type>(max_size * static_cast<decltype(max_size)>(mode != deletion_policy::swap_only));
+        return static_cast<size_type>(max_size * static_cast<std::remove_const_t<decltype(max_size)>>(mode != deletion_policy::swap_only));
     }
     }
 
 
     [[nodiscard]] auto entity_to_pos(const Entity entt) const noexcept {
     [[nodiscard]] auto entity_to_pos(const Entity entt) const noexcept {