Lines Matching +full:container +full:- +full:based
7 // https://www.apache.org/licenses/LICENSE-2.0
15 // -----------------------------------------------------------------------------
16 // File: container.h
17 // -----------------------------------------------------------------------------
19 // This header file provides Container-based versions of algorithmic functions
31 // `absl::c_xx(container, ...) are equivalent to std:: functions such as
36 // For template parameter and variable naming, `C` indicates the container type
122 auto c_size(C& c) -> decltype(c.size()) {
135 //------------------------------------------------------------------------------
137 //------------------------------------------------------------------------------
141 // Container-based version of absl::linear_search() for performing a linear
142 // search within a container.
150 //------------------------------------------------------------------------------
152 //------------------------------------------------------------------------------
156 // Container-based version of the <iterator> `std::distance()` function to
157 // return the number of elements within a container.
165 //------------------------------------------------------------------------------
166 // <algorithm> Non-modifying sequence operations
167 //------------------------------------------------------------------------------
171 // Container-based version of the <algorithm> `std::all_of()` function to
172 // test if all elements within a container satisfy a condition.
182 // Container-based version of the <algorithm> `std::any_of()` function to
183 // test if any element in a container fulfills a condition.
193 // Container-based version of the <algorithm> `std::none_of()` function to
194 // test if no elements in a container fulfill a condition.
204 // Container-based version of the <algorithm> `std::for_each()` function to
205 // apply a function to a container's elements.
215 // Container-based version of the <algorithm> `std::find()` function to find
216 // the first element containing the passed value within a container value.
226 // Container-based version of the <algorithm> `std::find_if()` function to find
227 // the first element in a container matching the given condition.
237 // Container-based version of the <algorithm> `std::find_if_not()` function to
238 // find the first element in a container not matching the given condition.
249 // Container-based version of the <algorithm> `std::find_end()` function to
250 // find the last subsequence within a container.
274 // Container-based version of the <algorithm> `std::find_first_of()` function to
275 // find the first element within the container that is also within the options
276 // container.
278 container_algorithm_internal::ContainerIter<C1> c_find_first_of(C1& container,
280 return std::find_first_of(container_algorithm_internal::c_begin(container),
281 container_algorithm_internal::c_end(container),
290 C1& container, C2& options, BinaryPredicate&& pred) {
291 return std::find_first_of(container_algorithm_internal::c_begin(container),
292 container_algorithm_internal::c_end(container),
300 // Container-based version of the <algorithm> `std::adjacent_find()` function to
301 // find equal adjacent elements within a container.
321 // Container-based version of the <algorithm> `std::count()` function to count
322 // values that match within a container.
333 // Container-based version of the <algorithm> `std::count_if()` function to
334 // count values matching a condition within a container.
345 // Container-based version of the <algorithm> `std::mismatch()` function to
389 // Container-based version of the <algorithm> `std::equal()` function to
393 // equal(): while the latter iterates over the second container only up to the
394 // size of the first container, c_equal() also checks whether the container
395 // sizes are equal. This better matches expectations about c_equal() based on
427 // Container-based version of the <algorithm> `std::is_permutation()` function
428 // to test whether a container is a permutation of another.
450 // Container-based version of the <algorithm> `std::search()` function to search
451 // a container for a subsequence.
475 // Container-based version of the <algorithm> `std::search_n()` function to
476 // search a container for the first sequence of N elements.
497 //------------------------------------------------------------------------------
499 //------------------------------------------------------------------------------
503 // Container-based version of the <algorithm> `std::copy()` function to copy a
504 // container's elements into an iterator.
513 // Container-based version of the <algorithm> `std::copy_n()` function to copy a
514 // container's first N elements into an iterator.
522 // Container-based version of the <algorithm> `std::copy_if()` function to copy
523 // a container's elements satisfying some condition into an iterator.
534 // Container-based version of the <algorithm> `std::copy_backward()` function to
535 // copy a container's elements in reverse order into an iterator.
545 // Container-based version of the <algorithm> `std::move()` function to move
546 // a container's elements into an iterator.
555 // Container-based version of the <algorithm> `std::move_backward()` function to
556 // move a container's elements into an iterator in reverse order.
565 // Container-based version of the <algorithm> `std::swap_ranges()` function to
566 // swap a container's elements with another container's elements. Swaps the
584 // Container-based version of the <algorithm> `std::transform()` function to
585 // transform a container's elements using the unary operation, storing the
618 // Container-based version of the <algorithm> `std::replace()` function to
619 // replace a container's elements of some value with a new value. The container
630 // Container-based version of the <algorithm> `std::replace_if()` function to
631 // replace a container's elements of some value with a new value based on some
632 // condition. The container is modified in place.
642 // Container-based version of the <algorithm> `std::replace_copy()` function to
643 // replace a container's elements of some value with a new value and return the
656 // Container-based version of the <algorithm> `std::replace_copy_if()` function
657 // to replace a container's elements of some value with a new value based on
669 // Container-based version of the <algorithm> `std::fill()` function to fill a
670 // container with some value.
679 // Container-based version of the <algorithm> `std::fill_n()` function to fill
680 // the first N elements in a container with some value.
688 // Container-based version of the <algorithm> `std::generate()` function to
689 // assign a container's elements to the values provided by the given generator.
699 // Container-based version of the <algorithm> `std::generate_n()` function to
700 // assign a container's first N elements to the values provided by the given
709 // Note: `c_xx()` <algorithm> container versions for `remove()`, `remove_if()`,
716 // Container-based version of the <algorithm> `std::remove_copy()` function to
717 // copy a container's elements while removing any elements matching the given
729 // Container-based version of the <algorithm> `std::remove_copy_if()` function
730 // to copy a container's elements while removing any elements matching the given
742 // Container-based version of the <algorithm> `std::unique_copy()` function to
743 // copy a container's elements while removing any elements containing duplicate
763 // Container-based version of the <algorithm> `std::reverse()` function to
764 // reverse a container's elements.
773 // Container-based version of the <algorithm> `std::reverse()` function to
774 // reverse a container's elements and write them to an iterator range.
784 // Container-based version of the <algorithm> `std::rotate()` function to
785 // shift a container's elements leftward such that the `middle` element becomes
786 // the first element in the container.
796 // Container-based version of the <algorithm> `std::rotate_copy()` function to
797 // shift a container's elements leftward such that the `middle` element becomes
811 // Container-based version of the <algorithm> `std::shuffle()` function to
812 // randomly shuffle elements within the container using a `gen()` uniform random
821 //------------------------------------------------------------------------------
823 //------------------------------------------------------------------------------
827 // Container-based version of the <algorithm> `std::is_partitioned()` function
828 // to test whether all elements in the container for which `pred` returns `true`
839 // Container-based version of the <algorithm> `std::partition()` function
840 // to rearrange all elements in a container in such a way that all elements for
852 // Container-based version of the <algorithm> `std::stable_partition()` function
853 // to rearrange all elements in a container in such a way that all elements for
867 // Container-based version of the <algorithm> `std::partition_copy()` function
868 // to partition a container's elements and return them into two iterators: one
883 // Container-based version of the <algorithm> `std::partition_point()` function
884 // to return the first element of an already partitioned container for which
894 //------------------------------------------------------------------------------
896 //------------------------------------------------------------------------------
900 // Container-based version of the <algorithm> `std::sort()` function
919 // Container-based version of the <algorithm> `std::stable_sort()` function
939 // Container-based version of the <algorithm> `std::is_sorted()` function
940 // to evaluate whether the given container is sorted in ascending order.
958 // Container-based version of the <algorithm> `std::partial_sort()` function
959 // to rearrange elements within a container such that elements before `middle`
983 // Container-based version of the <algorithm> `std::partial_sort_copy()`
986 // At most min(result.last - result.first, sequence.last - sequence.first)
1012 // Container-based version of the <algorithm> `std::is_sorted_until()` function
1013 // to return the first element within a container that is not sorted in
1033 // Container-based version of the <algorithm> `std::nth_element()` function
1034 // to rearrange the elements within a container such that the `nth` element
1058 //------------------------------------------------------------------------------
1060 //------------------------------------------------------------------------------
1064 // Container-based version of the <algorithm> `std::lower_bound()` function
1065 // to return an iterator pointing to the first element in a sorted container
1086 // Container-based version of the <algorithm> `std::upper_bound()` function
1087 // to return an iterator pointing to the first element in a sorted container
1108 // Container-based version of the <algorithm> `std::equal_range()` function
1110 // sorted container which compare equal to `value`.
1130 // Container-based version of the <algorithm> `std::binary_search()` function
1131 // to test if any element in the sorted container contains a value equivalent to
1150 //------------------------------------------------------------------------------
1152 //------------------------------------------------------------------------------
1156 // Container-based version of the <algorithm> `std::merge()` function
1180 // Container-based version of the <algorithm> `std::inplace_merge()` function
1181 // to merge a supplied iterator `middle` into a container.
1202 // Container-based version of the <algorithm> `std::includes()` function
1203 // to test whether a sorted container `c1` entirely contains another sorted
1204 // container `c2`.
1226 // Container-based version of the <algorithm> `std::set_union()` function
1263 // Container-based version of the <algorithm> `std::set_intersection()` function
1310 // Container-based version of the <algorithm> `std::set_difference()` function
1311 // to return an iterator containing elements present in the first container but
1348 // Container-based version of the <algorithm> `std::set_symmetric_difference()`
1350 // container or the other, but not both.
1387 //------------------------------------------------------------------------------
1389 //------------------------------------------------------------------------------
1393 // Container-based version of the <algorithm> `std::push_heap()` function
1394 // to push a value onto a container heap.
1412 // Container-based version of the <algorithm> `std::pop_heap()` function
1413 // to pop a value from a heap container.
1431 // Container-based version of the <algorithm> `std::make_heap()` function
1432 // to make a container a heap.
1450 // Container-based version of the <algorithm> `std::sort_heap()` function
1469 // Container-based version of the <algorithm> `std::is_heap()` function
1470 // to check whether the given container is a heap.
1488 // Container-based version of the <algorithm> `std::is_heap_until()` function
1489 // to find the first element in a given container which is not in heap order.
1507 //------------------------------------------------------------------------------
1509 //------------------------------------------------------------------------------
1513 // Container-based version of the <algorithm> `std::min_element()` function
1535 // Container-based version of the <algorithm> `std::max_element()` function
1557 // Container-based version of the <algorithm> `std::minmax_element()` function
1578 //------------------------------------------------------------------------------
1580 //------------------------------------------------------------------------------
1584 // Container-based version of the <algorithm> `std::lexicographical_compare()`
1586 // container sequences. The comparison is performed using `operator<`. Note
1587 // that capital letters ("A-Z") have ASCII values less than lowercase letters
1588 // ("a-z").
1614 // Container-based version of the <algorithm> `std::next_permutation()` function
1615 // to rearrange a container's elements into the next lexicographically greater
1634 // Container-based version of the <algorithm> `std::prev_permutation()` function
1635 // to rearrange a container's elements into the next lexicographically lesser
1652 //------------------------------------------------------------------------------
1654 //------------------------------------------------------------------------------
1658 // Container-based version of the <numeric> `std::iota()` function
1660 // after each element is written. and write them to the container.
1669 // Container-based version of the <numeric> `std::accumulate()` function
1670 // to accumulate the element values of a container to `init` and return that
1696 // Container-based version of the <numeric> `std::inner_product()` function
1697 // to compute the cumulative inner product of container element pairs.
1713 // the product between the two container's element pair).
1727 // Container-based version of the <numeric> `std::adjacent_difference()`
1750 // Container-based version of the <numeric> `std::partial_sum()` function