41#ifdef PB_DS_CLASS_C_DEC
45 typename PB_DS_CLASS_C_DEC::const_iterator,
46 typename PB_DS_CLASS_C_DEC::const_iterator>
48prefix_range(key_const_reference r_key)
const
50 const access_traits& r_traits = get_access_traits();
51 return (prefix_range(r_traits.begin(r_key), r_traits.end(r_key)));
56 typename PB_DS_CLASS_C_DEC::iterator,
57 typename PB_DS_CLASS_C_DEC::iterator>
59prefix_range(key_const_reference r_key)
61 return (prefix_range(get_access_traits().
begin(r_key),
62 get_access_traits().
end(r_key)));
67 typename PB_DS_CLASS_C_DEC::const_iterator,
68 typename PB_DS_CLASS_C_DEC::const_iterator>
70prefix_range(
typename access_traits::const_iterator b,
71 typename access_traits::const_iterator e)
const
74 const_cast<PB_DS_CLASS_C_DEC*
>(
this)->prefix_range(b, e);
76 return (std::make_pair(const_iterator(non_const_ret.
first),
77 const_iterator(non_const_ret.
second)));
82 typename PB_DS_CLASS_C_DEC::iterator,
83 typename PB_DS_CLASS_C_DEC::iterator>
85prefix_range(
typename access_traits::const_iterator b,
86 typename access_traits::const_iterator e)
88 Node_Itr nd_it = node_begin();
89 Node_Itr end_nd_it = node_end();
91 const access_traits& r_traits = get_access_traits();
96 if (nd_it == end_nd_it)
97 return (std::make_pair(
end(),
end()));
99 const size_type common_range_length =
100 base_type::common_prefix_len(nd_it, b, e, r_traits);
102 if (common_range_length >= given_range_length)
104 iterator ret_b = this->leftmost_it(nd_it);
105 iterator ret_e = this->rightmost_it(nd_it);
106 return (std::make_pair(ret_b, ++ret_e));
108 nd_it = next_child(nd_it, b, e, end_nd_it, r_traits);
113typename PB_DS_CLASS_C_DEC::node_iterator
115next_child(node_iterator nd_it,
typename access_traits::const_iterator b,
116 typename access_traits::const_iterator e, node_iterator end_nd_it,
117 const access_traits& r_traits)
119 const size_type num_children = nd_it.num_children();
120 node_iterator ret = end_nd_it;
121 size_type max_length = 0;
122 for (size_type i = 0; i < num_children; ++i)
124 node_iterator pot = nd_it.get_child(i);
125 const size_type common_range_length =
126 base_type::common_prefix_len(pot, b, e, r_traits);
128 if (common_range_length > max_length)
131 max_length = common_range_length;
140operator()(node_iterator , node_const_iterator )
const
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
Struct holding two objects of arbitrary type.
_T1 first
The first member.
_T2 second
The second member.