19template<
typename Self,
typename T>
22template<
typename T,
typename Tag>
25 template<
typename... Args>
29 constexpr auto value() -> T& {
return m_value; }
35template<
typename Self,
typename T>
39 constexpr static auto is_sized(
auto) ->
bool {
return false; }
45 constexpr static void did_remove(
auto& self,
auto& node) {
55template<
typename Value,
typename Eq,
concepts::Hasher Hasher,
typename Buckets,
typename Tag,
58 :
public NodeHashTable<Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map,
59 OwningNodeHashTable<Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map>> {
80 constexpr auto allocator() -> Alloc& {
return m_allocator; }
82 template<
typename U, concepts::Invocable F>
92 auto const hash = this->
hash(needle);
96 auto before_it = bucket->before_begin();
106 auto do_insert = [&] {
107 if constexpr (is_multi) {
110 return it == bucket->end();
124 before_it = bucket->before_begin();
127 }
else if constexpr (!is_multi) {
132 if constexpr (is_multi) {
133 if (it != bucket->end()) {
134 bucket->insert_after(it, *node);
136 return Iterator { this->
m_buckets.span(), bucket_index, it };
138 bucket->push_front(*node);
140 return Iterator { this->
m_buckets.span(), bucket_index, bucket->before_begin() };
142 if (it == bucket->end()) {
143 bucket->push_front(*node);
153 template<
typename U, concepts::Invocable F>
155 if constexpr (!is_multi) {
167 template<
typename... Args>
169 constexpr auto create_node(Args&&... args) {
173 return static_cast<Node*
>(pointer);
178 [[no_unique_address]] Alloc m_allocator {};
Definition const_iterator_impl.h:19
Definition hash_node_iterator.h:15
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::bucket_count constexpr auto bucket_count() const -> usize
Definition node_hash_table.h:110
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::m_size usize m_size
Definition node_hash_table.h:385
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::hash constexpr auto hash(U const &value) const -> u64
Definition node_hash_table.h:339
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::down_cast_self constexpr auto down_cast_self() -> decltype(auto)
Definition node_hash_table.h:74
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::size constexpr auto size() const -> usize
Definition node_hash_table.h:108
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::reserve constexpr auto reserve(usize new_capacity) -> decltype(util::declval< Buckets & >().reserve_from_nothing(new_capacity))
Definition node_hash_table.h:221
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::m_buckets Buckets m_buckets
Definition node_hash_table.h:384
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::node_value constexpr auto node_value(Node &node) const -> Value &
Definition node_hash_table.h:277
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::ConcreteNode decltype(Tag::node_type(in_place_type< Value >)) ConcreteNode
Definition node_hash_table.h:70
di::container::NodeHashTable< Value, Eq, Hasher, Buckets, Tag, Interface, is_multi, is_map, OwningNodeHashTable< Value, Eq, Hasher, Buckets, Tag, Alloc, Interface, is_multi, is_map > >::NodeHashTable friend class NodeHashTable
Definition node_hash_table.h:63
Definition owning_node_hash_table.h:59
constexpr auto insert_with_factory(U &&needle, F &&factory) -> InsertResult
Definition owning_node_hash_table.h:83
constexpr auto allocator() -> Alloc &
Definition owning_node_hash_table.h:80
constexpr auto insert_with_factory(ConstIterator, U &&needle, F &&factory)
Definition owning_node_hash_table.h:154
Definition operations.h:11
#define DI_TRY(...)
Definition monad_try.h:13
constexpr auto lookup(concepts::detail::ConstantVector auto &vector, size_t index) -> decltype(auto)
Definition vector_lookup.h:10
constexpr auto next
Definition next.h:35
constexpr auto equal
Definition equal.h:46
constexpr auto hash
Definition hash.h:21
constexpr auto invoke
Definition invoke.h:100
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
constexpr auto get(T &&value) -> decltype(auto)
Definition get.h:8
constexpr auto destroy_at
Definition destroy_at.h:24
constexpr auto construct_at
Definition construct_at.h:27
Tuple(Types...) -> Tuple< Types... >
constexpr auto allocate_one
Definition allocate_one.h:29
constexpr auto as_fallible
Definition as_fallible.h:26
constexpr auto try_infallible
Definition try_infallible.h:31
constexpr auto in_place
Definition in_place.h:8
constexpr auto deallocate_one
Definition deallocate_one.h:27
Definition intrusive_tag_base.h:8
Definition owning_node_hash_table.h:36
OwningHashNode< T, Self > Node
Definition owning_node_hash_table.h:37
static constexpr auto down_cast(InPlaceType< T >, Node &node) -> T &
Definition owning_node_hash_table.h:43
static constexpr auto down_cast(auto, auto &node) -> OwningHashNode< T, Self > &
Definition owning_node_hash_table.h:40
static constexpr auto allow_rehashing_in_insert(auto) -> bool
Definition owning_node_hash_table.h:52
static constexpr auto is_sized(auto) -> bool
Definition owning_node_hash_table.h:39
static constexpr void did_remove(auto &self, auto &node)
Definition owning_node_hash_table.h:45
Definition owning_node_hash_table.h:23
constexpr OwningHashNode(InPlace, Args &&... args)
Definition owning_node_hash_table.h:27
constexpr auto value() -> T &
Definition owning_node_hash_table.h:29
Definition in_place_type.h:5