Iros
 
Loading...
Searching...
No Matches
node_hash_map.h
Go to the documentation of this file.
1#pragma once
2
13#include "di/function/compare.h"
14#include "di/function/equal.h"
15#include "di/platform/prelude.h"
18
19namespace di::container {
20namespace detail {
21 template<typename Key, typename Value>
22 struct NodeHashMapTag : OwningHashNodeTag<NodeHashMapTag<Key, Value>, Tuple<Key, Value>> {};
23}
24
25template<typename Key, typename Value, typename Eq = function::Equal, concepts::Hasher Hasher = DefaultHasher,
26 typename Buckets = container::Vector<
30 : public OwningNodeHashTable<
31 Tuple<Key, Value>, Eq, Hasher, Buckets, detail::NodeHashMapTag<Key, Value>, Alloc,
32 MapInterface<
33 NodeHashMap<Key, Value, Eq, Hasher, Buckets, Alloc>, Tuple<Key, Value>, Key, Value,
34 HashNodeIterator<Tuple<Key, Value>, detail::NodeHashMapTag<Key, Value>>,
35 container::ConstIteratorImpl<HashNodeIterator<Tuple<Key, Value>, detail::NodeHashMapTag<Key, Value>>>,
36 detail::NodeHashTableMapValidForLookup<Key, Value, Eq>::template Type, false>,
37 false, true> {
38private:
39 using Base =
46 false, true>;
47
48public:
49 NodeHashMap() = default;
50
51 NodeHashMap(Eq, Hasher, Buckets const& comparator) : Base(Eq { comparator }) {}
52};
53
54template<concepts::InputContainer Con, concepts::TupleLike T = meta::ContainerValue<Con>>
55requires(meta::TupleSize<T> == 2)
58
59template<concepts::InputContainer Con, concepts::TupleLike T = meta::ContainerValue<Con>, typename Eq>
60requires(meta::TupleSize<T> == 2)
63
64template<concepts::InputContainer Con, concepts::TupleLike T = meta::ContainerValue<Con>, typename Eq, typename Hasher>
65requires(meta::TupleSize<T> == 2)
68}
69
70namespace di {
72}
Definition const_iterator_impl.h:19
Definition hash_node_iterator.h:15
Definition forward_list_forward_declaration.h:12
Definition map_interface.h:21
Definition node_hash_map.h:37
NodeHashMap(Eq, Hasher, Buckets const &comparator)
Definition node_hash_map.h:51
Definition owning_node_hash_table.h:59
Definition vector_forward_declaration.h:8
Definition tuple_forward_declaration.h:5
Definition allocator.h:9
Definition hasher.h:8
Definition sequence.h:13
Definition sequence.h:12
constexpr auto TupleSize
Definition tuple_size.h:23
decltype(vocab::tuple_element(types::in_place_type< meta::RemoveReference< T > >, c_< index >))::Type TupleElement
Definition tuple_element.h:21
container::InfallibleAllocator DefaultAllocator
Definition custom.h:39
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
Definition zstring_parser.h:9
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
Definition default_hasher.h:7
Definition owning_node_hash_table.h:36
Definition node_hash_map.h:22
Definition equal.h:8
Definition in_place_template.h:5