3 #include <wordring/static_vector/static_vector.hpp>
15 template <
typename Iterator>
18 template <
typename Iterator1>
21 template <
typename Iterator1>
25 using iterator_type = Iterator;
27 using difference_type =
typename std::iterator_traits<iterator_type>::difference_type;
28 using value_type = std::uint16_t;
29 using pointer = value_type*;
30 using reference = value_type&;
31 using iterator_category = std::input_iterator_tag;
33 using string_iterator =
typename iterator_type::string_iterator;
37 static constexpr std::uint16_t null_value = 256u;
46 std::pair<string_iterator, string_iterator> parent()
const
48 return m_queue.front().string();
56 bool empty()
const {
return m_queue.empty(); }
73 void assign_children()
78 auto it = m_queue.front();
79 auto it1 = it.begin();
84 m_labels.push_back(*it1);
85 if (it1.has_child()) m_queue.push_back(it1);
88 if (it.has_null()) m_labels.push_back(null_value);
92 std::deque<iterator_type> m_queue;
96 template <
typename Iterator1>
102 template <
typename Iterator1>
103 inline bool operator!=(trie_construct_iterator<Iterator1>
const& lhs, trie_construct_iterator<Iterator1>
const& rhs)
105 return lhs.m_queue.size() != rhs.m_queue.size() || lhs.m_queue != rhs.m_queue;