dense_hash_map/set: suppress warnings due to integral conversions

This commit is contained in:
Michele Caini
2022-01-25 09:09:37 +01:00
parent 1caa8d923d
commit 0cec8de164
2 changed files with 4 additions and 4 deletions

View File

@@ -256,7 +256,7 @@ class dense_hash_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() + it.index();
return begin() + static_cast<typename iterator::difference_type>(it.index());
}
}
@@ -267,7 +267,7 @@ class dense_hash_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() + it.index();
return cbegin() + static_cast<typename iterator::difference_type>(it.index());
}
}

View File

@@ -255,7 +255,7 @@ class dense_hash_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() + it.index();
return begin() + static_cast<typename iterator::difference_type>(it.index());
}
}
@@ -266,7 +266,7 @@ class dense_hash_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() + it.index();
return cbegin() + static_cast<typename iterator::difference_type>(it.index());
}
}