Skip to content

Commit

Permalink
Auto-format
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-sparus committed Aug 21, 2024
1 parent 3dd6df5 commit f0d279c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 18 deletions.
5 changes: 3 additions & 2 deletions immer/detail/hamts/champ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ struct champ

static node_t* empty()
{
static const auto empty_ = []{
static const auto empty_ = [] {
constexpr auto size = node_t::sizeof_inner_n(0);
static std::aligned_storage_t<size, alignof(std::max_align_t)> storage;
static std::aligned_storage_t<size, alignof(std::max_align_t)>
storage;
return node_t::make_inner_n_into(&storage, size, 0u);
}();
return empty_->inc();
Expand Down
7 changes: 4 additions & 3 deletions immer/detail/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ const T& as_const(T& x)
return x;
}

template<std::size_t Size, std::size_t Align>
template <std::size_t Size, std::size_t Align>
struct aligned_storage
{
struct type {
struct type
{
alignas(Align) unsigned char data[Size];
};
};

template<std::size_t Size, std::size_t Align>
template <std::size_t Size, std::size_t Align>
using aligned_storage_t = typename aligned_storage<Size, Align>::type;

template <typename T>
Expand Down
10 changes: 4 additions & 6 deletions immer/heap/debug_size_heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#pragma once

#include <immer/config.hpp>
#include <immer/heap/identity_heap.hpp>
#include <immer/detail/util.hpp>
#include <immer/heap/identity_heap.hpp>

#include <cassert>
#include <cstddef>
Expand Down Expand Up @@ -39,11 +39,9 @@ struct debug_size_heap
// fixed.
constexpr static auto extra_size = 8;
#else
constexpr static auto extra_size = sizeof(
detail::aligned_storage_t<
sizeof(std::size_t), alignof(std::max_align_t)
>
);
constexpr static auto extra_size =
sizeof(detail::aligned_storage_t<sizeof(std::size_t),
alignof(std::max_align_t)>);
#endif

template <typename... Tags>
Expand Down
2 changes: 1 addition & 1 deletion immer/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class map
using mapped_type = T;
using value_type = std::pair<K, T>;
using size_type = detail::hamts::size_t;
using difference_type = std::ptrdiff_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = Equal;
using reference = const value_type&;
Expand Down
2 changes: 1 addition & 1 deletion immer/map_transient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class map_transient : MemoryPolicy::transience_t::owner
using mapped_type = T;
using value_type = std::pair<K, T>;
using size_type = detail::hamts::size_t;
using difference_type = std::ptrdiff_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = Equal;
using reference = const value_type&;
Expand Down
3 changes: 1 addition & 2 deletions immer/set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class set
public:
using value_type = T;
using size_type = detail::hamts::size_t;
using difference_type = std::ptrdiff_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = Equal;
using reference = const T&;
Expand Down Expand Up @@ -303,5 +303,4 @@ static_assert(std::is_nothrow_move_constructible<set<int>>::value,
static_assert(std::is_nothrow_move_assignable<set<int>>::value,
"set is not nothrow move assignable");


} // namespace immer
2 changes: 1 addition & 1 deletion immer/set_transient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class set_transient : MemoryPolicy::transience_t::owner

using value_type = T;
using size_type = detail::hamts::size_t;
using difference_type = std::ptrdiff_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = Equal;
using reference = const T&;
Expand Down
2 changes: 1 addition & 1 deletion immer/table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class table
using mapped_type = T;
using value_type = T;
using size_type = detail::hamts::size_t;
using difference_type = std::ptrdiff_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = Equal;
using reference = const value_type&;
Expand Down
2 changes: 1 addition & 1 deletion immer/table_transient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class table_transient : MemoryPolicy::transience_t::owner
using mapped_type = T;
using value_type = T;
using size_type = detail::hamts::size_t;
using difference_type = std::ptrdiff_t;
using difference_type = std::ptrdiff_t;
using hasher = Hash;
using key_equal = Equal;
using reference = const value_type&;
Expand Down

0 comments on commit f0d279c

Please sign in to comment.