43 typename PB_DS_CLASS_C_DEC::const_iterator,
44 typename PB_DS_CLASS_C_DEC::const_iterator>
46 prefix_range(key_const_reference r_key)
const 48 const access_traits& r_traits = get_access_traits();
49 return (prefix_range(r_traits.begin(r_key), r_traits.end(r_key)));
54 typename PB_DS_CLASS_C_DEC::iterator,
55 typename PB_DS_CLASS_C_DEC::iterator>
57 prefix_range(key_const_reference r_key)
59 return (prefix_range(get_access_traits().
begin(r_key),
60 get_access_traits().
end(r_key)));
65 typename PB_DS_CLASS_C_DEC::const_iterator,
66 typename PB_DS_CLASS_C_DEC::const_iterator>
68 prefix_range(
typename access_traits::const_iterator b,
69 typename access_traits::const_iterator e)
const 72 const_cast<PB_DS_CLASS_C_DEC*
>(
this)->prefix_range(b, e);
75 const_iterator(non_const_ret.
second)));
80 typename PB_DS_CLASS_C_DEC::iterator,
81 typename PB_DS_CLASS_C_DEC::iterator>
83 prefix_range(
typename access_traits::const_iterator b,
84 typename access_traits::const_iterator e)
86 Node_Itr nd_it = node_begin();
87 Node_Itr end_nd_it = node_end();
89 const access_traits& r_traits = get_access_traits();
94 if (nd_it == end_nd_it)
97 const size_type common_range_length =
98 base_type::common_prefix_len(nd_it, b, e, r_traits);
100 if (common_range_length >= given_range_length)
102 iterator ret_b = this->leftmost_it(nd_it);
103 iterator ret_e = this->rightmost_it(nd_it);
106 nd_it = next_child(nd_it, b, e, end_nd_it, r_traits);
111 typename PB_DS_CLASS_C_DEC::node_iterator
113 next_child(node_iterator nd_it,
typename access_traits::const_iterator b,
114 typename access_traits::const_iterator e, node_iterator end_nd_it,
115 const access_traits& r_traits)
117 const size_type num_children = nd_it.num_children();
118 node_iterator ret = end_nd_it;
119 size_type max_length = 0;
120 for (size_type i = 0; i < num_children; ++i)
122 node_iterator pot = nd_it.get_child(i);
123 const size_type common_range_length =
124 base_type::common_prefix_len(pot, b, e, r_traits);
126 if (common_range_length > max_length)
129 max_length = common_range_length;
138 operator()(node_iterator , node_const_iterator )
const _T2 second
first is a copy of the first object
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initializer_list.
_T1 first
second_type is the second bound type
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initializer_list. ...
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > make_pair(_T1 &&__x, _T2 &&__y)
A convenience wrapper for creating a pair from two objects.
_GLIBCXX17_CONSTEXPR iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
Struct holding two objects of arbitrary type.