14template<
typename Value,
typename Tag>
26 : m_buckets({
const_cast<Bucket*
>(buckets.data()), buckets.size() }), m_bucket_index(
bucket_index) {
27 if (m_bucket_index < m_buckets.size()) {
28 m_before_current = m_buckets[m_bucket_index].before_begin();
33 BucketIter current_current)
34 : m_buckets({
const_cast<Bucket*
>(buckets.data()), buckets.size() })
36 , m_before_current(current_current) {}
39 DI_ASSERT(m_before_current != BucketIter {});
43 constexpr auto operator->() const -> Value* {
return util::addressof(**
this); }
46 DI_ASSERT(m_before_current != BucketIter {});
53 while (m_bucket_index < m_buckets.size()) {
54 m_before_current = m_buckets[m_bucket_index].before_begin();
62 m_before_current = {};
65 constexpr auto before_current() const -> BucketIter {
return m_before_current; }
67 constexpr auto node() const -> Node& {
return static_cast<Node&
>(*
container::next(m_before_current).node()); }
71 return a.m_before_current == b.m_before_current;
75 usize m_bucket_index { 0 };
76 BucketIter m_before_current {};
#define DI_ASSERT(...)
Definition assert_bool.h:7
constexpr auto bucket_index() const -> usize
Definition hash_node_iterator.h:66
constexpr void advance_one()
Definition hash_node_iterator.h:45
constexpr auto operator->() const -> Value *
Definition hash_node_iterator.h:43
constexpr auto before_current() const -> BucketIter
Definition hash_node_iterator.h:65
constexpr HashNodeIterator(vocab::Span< Bucket const > buckets, usize bucket_index)
Definition hash_node_iterator.h:25
constexpr auto operator*() const -> Value &
Definition hash_node_iterator.h:38
HashNodeIterator()=default
constexpr HashNodeIterator(vocab::Span< Bucket const > buckets, usize bucket_index, BucketIter current_current)
Definition hash_node_iterator.h:32
constexpr friend auto operator==(HashNodeIterator const &a, HashNodeIterator const &b) -> bool
Definition hash_node_iterator.h:70
constexpr auto node() const -> Node &
Definition hash_node_iterator.h:67
Definition forward_list_forward_declaration.h:12
Definition span_forward_declaration.h:10
constexpr auto next
Definition next.h:35
constexpr auto end
Definition end.h:47
size_t usize
Definition integers.h:33
constexpr auto in_place_type
Definition in_place_type.h:12