Lines Matching defs:first
34 // selects only the last of consecutive values instead of the first.
36 Iterator LastUnique(Iterator first, Iterator last, BinaryPredicate compare) {
37 Iterator replacable = std::adjacent_find(first, last, compare);
43 first = std::next(replacable);
46 if (first == last)
51 for (Iterator next = std::next(first); next != last; ++next, ++first) {
52 if (!compare(*first, *next))
53 *replacable++ = std::move(*first);
57 *replacable++ = std::move(*first);
137 flat_tree(InputIterator first,
162 // Takes the first if there are duplicates in the initializer list.
224 // This method inserts the values from the range [first, last) into the
228 void insert(InputIterator first,
243 // erase(position), erase(first, last) can take O(size).
251 iterator erase(const_iterator first, const_iterator last);
345 // Similar to |emplace_key_args|, but checks |hint| first as a possible
403 // - Instead of searching [begin(), end()) it only searches [first, last).
405 // underlying body and an iterator to the next bigger element in [first,
408 std::pair<iterator, bool> append_or_assign(iterator first,
411 auto position = std::lower_bound(first, last, val, value_comp());
426 // - Instead of searching [begin(), end()) it only searches [first, last).
428 // underlying body and an iterator to the next bigger element in [first,
431 std::pair<iterator, bool> append_unique(iterator first,
434 auto position = std::lower_bound(first, last, val, value_comp());
447 void sort_and_unique(iterator first,
451 std::stable_sort(first, last, impl_.get_value_comp());
462 erase_after = std::unique(first, last, comparator);
465 erase_after = LastUnique(first, last, comparator);
510 InputIterator first,
514 : impl_(comp, first, last) {
701 .first;
710 .first;
716 InputIterator first,
719 if (first == last)
726 is_multipass<InputIterator>() && std::next(first) == last;
730 for (; first != last; ++first)
731 insert_or_assign(*first);
733 std::copy(first, last, std::inserter(*this, end()));
744 // For batch updates initialize the first insertion point.
748 // existing ones, if applicable. Keep track of the first insertion point.
750 for (; first != last; ++first) {
752 append_or_assign(begin(), middle(), *first);
755 std::min(pos_first_new, std::distance(begin(), result.first));
759 for (; first != last; ++first) {
761 append_unique(begin(), middle(), *first);
764 std::min(pos_first_new, std::distance(begin(), result.first));
812 auto res = std::distance(eq_range.first, eq_range.second);
813 erase(eq_range.first, eq_range.second);
819 const_iterator first,
821 return impl_.body_.erase(first, last);
847 return std::distance(eq_range.first, eq_range.second);
862 return (eq_range.first == eq_range.second) ? end() : eq_range.first;
870 return {const_cast_it(res.first), const_cast_it(res.second)};