a few fixes due to update of clang-tidy to 21.1.4

This commit is contained in:
Martin Leitner-Ankerl
2025-11-02 21:05:55 +01:00
parent 333befcb07
commit 61fb2a2036
2 changed files with 10 additions and 9 deletions

View File

@@ -10,19 +10,20 @@ Checks: >-
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-fuchsia-default-arguments-calls,
-llvmlibc-implementation-in-namespace,
-modernize-use-constraints,
-fuchsia-trailing-return,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,
-llvmlibc-inline-function-decl,
-llvmlibc-restrict-system-libc-headers,
-modernize-macro-to-enum,
-modernize-use-constraints,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-use-concise-preprocessor-directives,
HeaderFilterRegex: '.*unordered_dense\.h'
CheckOptions:
cppcoreguidelines-avoid-do-while.IgnoreMacros: 'true'

View File

@@ -1802,7 +1802,7 @@ public:
bucket_idx = next(bucket_idx);
}
do_erase(bucket_idx, [](value_type const& /*unused*/) {
do_erase(bucket_idx, [](value_type const& /*unused*/) -> void {
});
return begin() + static_cast<difference_type>(value_idx_to_remove);
}
@@ -1817,7 +1817,7 @@ public:
}
auto tmp = std::optional<value_type>{};
do_erase(bucket_idx, [&tmp](value_type&& val) {
do_erase(bucket_idx, [&tmp](value_type&& val) -> void {
tmp = std::move(val);
});
return std::move(tmp).value();
@@ -1858,13 +1858,13 @@ public:
}
auto erase(Key const& key) -> std::size_t {
return do_erase_key(key, [](value_type const& /*unused*/) {
return do_erase_key(key, [](value_type const& /*unused*/) -> void {
});
}
auto extract(Key const& key) -> std::optional<value_type> {
auto tmp = std::optional<value_type>{};
do_erase_key(key, [&tmp](value_type&& val) {
do_erase_key(key, [&tmp](value_type&& val) -> void {
tmp = std::move(val);
});
return tmp;
@@ -1872,14 +1872,14 @@ public:
template <class K, class H = Hash, class KE = KeyEqual, std::enable_if_t<is_transparent_v<H, KE>, bool> = true>
auto erase(K&& key) -> std::size_t {
return do_erase_key(std::forward<K>(key), [](value_type const& /*unused*/) {
return do_erase_key(std::forward<K>(key), [](value_type const& /*unused*/) -> void {
});
}
template <class K, class H = Hash, class KE = KeyEqual, std::enable_if_t<is_transparent_v<H, KE>, bool> = true>
auto extract(K&& key) -> std::optional<value_type> {
auto tmp = std::optional<value_type>{};
do_erase_key(std::forward<K>(key), [&tmp](value_type&& val) {
do_erase_key(std::forward<K>(key), [&tmp](value_type&& val) -> void {
tmp = std::move(val);
});
return tmp;