Skip to content

Commit 562d25c

Browse files
committed
container: handle conversion warnings
1 parent b10ba4d commit 562d25c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: src/entt/container/dense_map.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class dense_map {
277277
[[nodiscard]] auto constrained_find(const Other &key, std::size_t bucket) {
278278
for(auto it = begin(bucket), last = end(bucket); it != last; ++it) {
279279
if(packed.second()(it->first, key)) {
280-
return begin() + static_cast<typename iterator::difference_type>(it.index());
280+
return begin() + static_cast<difference_type>(it.index());
281281
}
282282
}
283283

@@ -288,7 +288,7 @@ class dense_map {
288288
[[nodiscard]] auto constrained_find(const Other &key, std::size_t bucket) const {
289289
for(auto it = cbegin(bucket), last = cend(bucket); it != last; ++it) {
290290
if(packed.second()(it->first, key)) {
291-
return cbegin() + static_cast<typename const_iterator::difference_type>(it.index());
291+
return cbegin() + static_cast<difference_type>(it.index());
292292
}
293293
}
294294

Diff for: src/entt/container/dense_set.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class dense_set {
236236
[[nodiscard]] auto constrained_find(const Other &value, std::size_t bucket) {
237237
for(auto it = begin(bucket), last = end(bucket); it != last; ++it) {
238238
if(packed.second()(*it, value)) {
239-
return begin() + static_cast<typename iterator::difference_type>(it.index());
239+
return begin() + static_cast<difference_type>(it.index());
240240
}
241241
}
242242

@@ -247,7 +247,7 @@ class dense_set {
247247
[[nodiscard]] auto constrained_find(const Other &value, std::size_t bucket) const {
248248
for(auto it = cbegin(bucket), last = cend(bucket); it != last; ++it) {
249249
if(packed.second()(*it, value)) {
250-
return cbegin() + static_cast<typename const_iterator::difference_type>(it.index());
250+
return cbegin() + static_cast<difference_type>(it.index());
251251
}
252252
}
253253

Diff for: src/entt/container/table.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class basic_table {
419419
*/
420420
void erase(const size_type pos) {
421421
ENTT_ASSERT(pos < size(), "Index out of bounds");
422-
erase(begin() + static_cast<typename iterator::difference_type>(pos));
422+
erase(begin() + static_cast<difference_type>(pos));
423423
}
424424

425425
/**

0 commit comments

Comments
 (0)