Algorithms
- all_of - checks if unary predicate returns true for every element in a range.
- any_of - checks if unary predicate returns true for at least one element in a range.
- none_of - checks if unary predicate returns true for no elements in a range.
- for_each - applies function to each element in a range. Function return result is ignored.
- for_each_n - applies function to each element in a range from first to first + n
- count - counts the elements in a range.
- count_if - applies function to each element in a range and counts the number of times the function returns true
- mismatch - returns a pair of iterators to the first mismatching of elements between to ranges.
- find - returns the first iterator in a range that statisfies a given criteria or the last iterator if no such match exists
- find_if - applies function to each element in range and returns iterator for first element that returns true.
- find_if_not - applies function to each element in range and returns iterator for first element that returns false.
- find_end - finds the last occurrence of a sequence in a range.
- find_first_of - searches a range for any elements present in another range.
- adjacent_find - searches a range for two consecutive equal elements.
- search - searches for the first occurrance of a sequence in a range.
- search_n - searches a range for the first sequence of count size of identical elements equal to a given value.
- copy - copies elements of a range to another range starting at a given position.
- copy_if - copies elements of a range to another range where the predicate function returns true.
- copy_n - copies count elements from a range starting a some position to a given destination.
- copy_backward - copies elements in a range to another range ending at a given position and in reverse order.
- move - moves elements in a range to another range.
- move_backward - moves elements in a range to another range ending at a given position and copies the elements in reverse order.
- fill - fill each element in a range with the same value.
- fill_n - fill each element for a given count with the same value.
- transform - applies function to each element in a range and returns element with new values.
- generate - assigns to each element in a range a value generated by a function.
- remove - removes all elements in a range equal to a value.
- remove_if - removes all elements in a range where predicate function returns true.
- remove_copy - copies elements from range to another range starting at given position and skipping elements equal to a given value.
- remove_copy_if - copies elements from range to another range starting at given position and skipping elements where predicate returns true.
- replace - replaces all the elemets in a range equal to a given value with another value
- replace_if - replaces all elements in a range where predicate returns true.
- replace_copy - copies all elements in range to another range at given position replacing elements equal to criteria with new value.
- replace_copy_if - copies all elements in range to another range at given position replacing elements where predicate equals true with new value.
- swap - exchanges values between two elements.
- swap_ranges - exchanges elements between ranges.
- iter_swap - swaps the values of elements pointed to by different iterators.
- reverse - reverses order of elements in a range.
- reverse_copy - copies range to another range in reverse order.
- rotate - swaps subranges within range so beginning range [first, middle) follows ending range (middle, last].
- rotate_copy
- shuffle - randomizes elements in a range
- sample - selects elements at random from a range.
- unique - removes all elements except the first element in a consecutive group of elements with the same value
- unique_copy - copies elements from one range to another range ensuring no consecutive elements containing the same value.
- is_partitioned - checks the partition state of a range
- partition - sorts the range so that the elements for which the predicate returns true appear before the elements that return false.
- partition_copy - copies elements from a range to two other ranges depending on return value of predicate.
- stable_partition - same as partition but relative order is preserved.
- partition_point - finds the first element that doesn't satisfy the predicate for a partitioned range
- is_sorted - checks if the elements in a range are sorted in non-descending order.
- is_sorted_until - finds the largest subrange sorted in non-descinding order within a range.
- sort - sorts a range in non-descending order.
- partial_sort -
- partial_sort_copy - sorts elements in a range in ascending order and stores the result in another range.
- stable_sort -
- nth_element - rearranges elements in range.
- lower_bound - *Searches for the first element in the partitioned range which is not ordered before value
- upper_bound - *Searches for the first element in the partitioned range which is ordered after value.
- binary_search - searches for value in a partitioned range.
- equal_range - *Returns a range containing all elements equivalent to value in the partitioned range
- merge -
- inplace_merge - merges two consecutive sorted subranges into one range
- includes - is a sorted range a subrange of another range
- set_difference - copies the elements in a range that don't appear in another range to an output range.
- set_intersection find elements that appear in two sorted ranges.
- set_union -
- is_heap - checks if range is a heap.
- is_heap_until - searches a range for the largest subrange which is a heap.
- make_heap - constructs a heap.
- push_heap - insert elements into heap.
- pop_heap - removes first element from heap.
- sort_heap - converts heap into sorted range.
- max - returns the larger of two values.
- max_element - finds the largest element in a range.
- min - returns the smaller of two values.
- min_element - finds the smallest element in a range.
- minmax - returns smallest and largest of the given values.
- minmax_element - finds smallest and largest values in a range.
- clamp - if values is between low and high returns value otherwise returns closest boundary.
- equal - checks if two ranges are equal
- lexicographical_compare
- is_permutation - checks if a range is a permutation of another range.
- next_permutation - tries to permute a range into the next permutation if it exists.
- prev_permutation - tries to permute a range into the previous permutation if it exists.
C++ Examples© 2024 TBD