54 template <
typename Iterator,
typename Predicate>
58 const Predicate predicate)
65 if (predicate( begin[0] ) == predicate( begin[n-1] ))
66 return predicate( begin[0] ) ? begin + n :
begin;
73 const uint32 count2 = count / 2;
75 Iterator mid = begin + count2;
77 if (predicate( *mid ) ==
false)
78 begin = ++mid, count -= count2 + 1;
90 template <
typename Iterator,
typename Value,
typename index_type>
108 index_type count = n;
112 const index_type count2 = count / 2;
114 Iterator mid = begin + count2;
117 begin = ++mid, count -= count2 + 1;
129 template <
typename Iterator,
typename Value,
typename index_type>
146 index_type count = n;
150 const index_type step = count / 2;
152 Iterator it = begin + step;
170 template <
typename Iterator,
typename Value,
typename index_type>
184 template <
typename Iterator,
typename Value,
typename index_type>
190 return index_type(
upper_bound( x, begin, n ) - begin );
202 typename input_iterator1,
203 typename input_iterator2,
204 typename output_iterator>
207 input_iterator1 first1,
208 input_iterator1 end1,
209 input_iterator2 first2,
210 input_iterator2 end2,
211 output_iterator output)
213 while (first1 != end1 &&
216 if (*first2 < *first1)
232 while (first1 != end1)
240 while (first2 != end2)
258 typename key_iterator1,
259 typename key_iterator2,
260 typename value_iterator1,
261 typename value_iterator2,
262 typename key_iterator,
263 typename value_iterator>
266 key_iterator1 first1,
268 key_iterator2 first2,
270 value_iterator1 values1,
271 value_iterator2 values2,
272 key_iterator output_keys,
273 value_iterator output_values)
275 while (first1 != end1 &&
278 if (*first2 < *first1)
280 *output_keys = *first2;
281 *output_values = *values2;
288 *output_keys = *first1;
289 *output_values = *values1;
299 while (first1 != end1)
301 *output_keys = *first1;
302 *output_values = *values1;
310 while (first2 != end2)
312 *output_keys = *first2;
313 *output_values = *values2;