Skip to content

Commit

Permalink
clang-format version 19.1.4 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
martinus committed Dec 3, 2024
1 parent 00a0c1a commit 67e8d7b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
13 changes: 6 additions & 7 deletions include/ankerl/unordered_dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,17 @@ inline void mum(uint64_t* a, uint64_t* b) {

ANKERL_UNORDERED_DENSE_EXPORT template <typename T, typename Enable = void>
struct hash {
auto operator()(T const& obj) const
noexcept(noexcept(std::declval<std::hash<T>>().operator()(std::declval<T const&>()))) -> uint64_t {
auto operator()(T const& obj) const noexcept(noexcept(std::declval<std::hash<T>>().operator()(std::declval<T const&>())))
-> uint64_t {
return std::hash<T>{}(obj);
}
};

template <typename T>
struct hash<T, typename std::hash<T>::is_avalanching> {
using is_avalanching = void;
auto operator()(T const& obj) const
noexcept(noexcept(std::declval<std::hash<T>>().operator()(std::declval<T const&>()))) -> uint64_t {
auto operator()(T const& obj) const noexcept(noexcept(std::declval<std::hash<T>>().operator()(std::declval<T const&>())))
-> uint64_t {
return std::hash<T>{}(obj);
}
};
Expand Down Expand Up @@ -1113,9 +1113,8 @@ class table : public std::conditional_t<is_map_v<T>, base_table_type_map<T>, bas
}

template <typename... Args>
auto do_place_element(dist_and_fingerprint_type dist_and_fingerprint,
value_idx_type bucket_idx,
Args&&... args) -> std::pair<iterator, bool> {
auto do_place_element(dist_and_fingerprint_type dist_and_fingerprint, value_idx_type bucket_idx, Args&&... args)
-> std::pair<iterator, bool> {

// emplace the new value. If that throws an exception, no harm done; index is still in a valid state
m_values.emplace_back(std::forward<Args>(args)...);
Expand Down
16 changes: 12 additions & 4 deletions test/unit/ctors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,18 @@ TEST_CASE_MAP("ctors_map", counter::obj, counter::obj) {
auto counts = counter();
INFO(counts);

{ auto m = map_t{}; }
{ auto m = map_t{0, alloc_t{}}; }
{ auto m = map_t{0, hash_t{}, alloc_t{}}; }
{ auto m = map_t{alloc_t{}}; }
{
auto m = map_t{};
}
{
auto m = map_t{0, alloc_t{}};
}
{
auto m = map_t{0, hash_t{}, alloc_t{}};
}
{
auto m = map_t{alloc_t{}};
}
REQUIRE(counts.dtor() == 0);

{
Expand Down
4 changes: 3 additions & 1 deletion test/unit/pmr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ TEST_CASE_PMR_MAP("pmr", uint64_t, uint64_t) {

TEST_CASE_PMR_MAP("pmr_no_null", uint64_t, uint64_t) {
auto mr = no_null_memory_resource();
{ auto map = map_t(&mr); }
{
auto map = map_t(&mr);
}
{
auto map = map_t(&mr);
for (size_t i = 0; i < 1; ++i) {
Expand Down
8 changes: 6 additions & 2 deletions test/unit/windows_include.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ TEST_CASE("unordered_dense_with_windows_h") {
auto key = size_t{6};
map.erase(counter::obj(key, counts));
}
{ map = map_t{}; }
{
map = map_t{};
}
{
auto m = map_t{};
m.swap(map);
}
{ map.clear(); }
{
map.clear();
}
{
auto s = size_t{7};
map.rehash(s);
Expand Down

0 comments on commit 67e8d7b

Please sign in to comment.