From 562d25c7caeb6d64ce930bef08e2bafbaa4ff3f1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 10 Feb 2025 11:09:39 +0100 Subject: [PATCH] container: handle conversion warnings --- src/entt/container/dense_map.hpp | 4 ++-- src/entt/container/dense_set.hpp | 4 ++-- src/entt/container/table.hpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/entt/container/dense_map.hpp b/src/entt/container/dense_map.hpp index aeaa1d5d6..23baa3bf9 100644 --- a/src/entt/container/dense_map.hpp +++ b/src/entt/container/dense_map.hpp @@ -277,7 +277,7 @@ class dense_map { [[nodiscard]] auto constrained_find(const Other &key, std::size_t bucket) { for(auto it = begin(bucket), last = end(bucket); it != last; ++it) { if(packed.second()(it->first, key)) { - return begin() + static_cast(it.index()); + return begin() + static_cast(it.index()); } } @@ -288,7 +288,7 @@ class dense_map { [[nodiscard]] auto constrained_find(const Other &key, std::size_t bucket) const { for(auto it = cbegin(bucket), last = cend(bucket); it != last; ++it) { if(packed.second()(it->first, key)) { - return cbegin() + static_cast(it.index()); + return cbegin() + static_cast(it.index()); } } diff --git a/src/entt/container/dense_set.hpp b/src/entt/container/dense_set.hpp index e88c6c872..52258add0 100644 --- a/src/entt/container/dense_set.hpp +++ b/src/entt/container/dense_set.hpp @@ -236,7 +236,7 @@ class dense_set { [[nodiscard]] auto constrained_find(const Other &value, std::size_t bucket) { for(auto it = begin(bucket), last = end(bucket); it != last; ++it) { if(packed.second()(*it, value)) { - return begin() + static_cast(it.index()); + return begin() + static_cast(it.index()); } } @@ -247,7 +247,7 @@ class dense_set { [[nodiscard]] auto constrained_find(const Other &value, std::size_t bucket) const { for(auto it = cbegin(bucket), last = cend(bucket); it != last; ++it) { if(packed.second()(*it, value)) { - return cbegin() + static_cast(it.index()); + return cbegin() + static_cast(it.index()); } } diff --git a/src/entt/container/table.hpp b/src/entt/container/table.hpp index afec4c139..34dcd64d9 100644 --- a/src/entt/container/table.hpp +++ b/src/entt/container/table.hpp @@ -419,7 +419,7 @@ public: */ void erase(const size_type pos) { ENTT_ASSERT(pos < size(), "Index out of bounds"); - erase(begin() + static_cast(pos)); + erase(begin() + static_cast(pos)); } /**