Algorithms A set of algorithms from the STL. If ETL_NO_STL is defined then the ETL implements its own reverse engineered versions. Otherwise, the ETL will often be a wrapper around the STL's implementation. Functions returning pair will either use std::pair or, if ETL_NO_STL is defined, etl::pair. Constexpr Some algorithms will be constexpr, dependent on the compiler support and ETL setup. ____________________________________________________________________________________________________ swap Only defined if ETL_NO_STL is defined. template void swap(T& a, T& b) ETL_NOEXCEPT Swaps two values ____________________________________________________________________________________________________ template void swap(T(&a)[N], T(&b)[N]) ETL_NOEXCEPT Swaps two arrays https://en.cppreference.com/w/cpp/algorithm/swap ____________________________________________________________________________________________________ iter_swap template void iter_swap(TIterator1 a, TIterator2 b) Swaps the elements pointed to by two iterators https://en.cppreference.com/w/cpp/algorithm/iter_swap ____________________________________________________________________________________________________ swap_ranges template TIterator2 swap_ranges(T1terator1 first1, T1terator1 last1, TIterator2 first2) Swaps two ranges of elements https://en.cppreference.com/w/cpp/algorithm/swap_ranges ____________________________________________________________________________________________________ copy template TOutputIterator copy(TInputIterator sb, TInputIterator se, TOutputIterator db) Copies the elements in the range, defined by sb, se, to another range beginning at db https://en.cppreference.com/w/cpp/algorithm/copy Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ copy_s ETL extension template TOutputIterator copy_s(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end) A safer four parameter version that will stop copying when either iterator reaches the end of its range. Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ copy_n template TOutputIterator copy_n(TInputIterator begin, TSize n, TOutputIterator result) Copies exactly n values from the range beginning at begin to the range beginning at result. https://en.cppreference.com/w/cpp/algorithm/copy_n Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ copy_n_s ETL extension template TOutputIterator copy_n_s(TInputIterator i_begin, TSize n, TOutputIterator o_begin, TOutputIterator o_end) A safer version that will stop copying when either n items have been copied or the output iterator reaches the end of its range. ____________________________________________________________________________________________________ template TOutputIterator copy_n_s(TIterator i_begin, TSize1 n1, TOutputIterator o_begin, TSize1 n2,) A safer version that will stop copying when either n1 or n2 items have been copied. Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ copy_if template ETL_CONSTEXPR14 TOutputIterator copy_if(TIterator begin, TIterator end, TOutputIterator out, TUnaryPredicate predicate) Only copies the elements for which the predicate predicate returns true https://en.cppreference.com/w/cpp/algorithm/copy ____________________________________________________________________________________________________ copy_if_s ETL extension template ETL_CONSTEXPR14 TOutputIterator copy_if_s(TIterator i_begin, TIterator i_end, TOutputIterator o_begin, TOutputIterator o_end, TUnaryPredicate predicate) A safer version that will stop copying when either iterator reaches the end of its range ____________________________________________________________________________________________________ copy_n_if ETL extension template ETL_CONSTEXPR14 TOutputIterator copy_n_if(TIterator begin, TSize n, TOutputIterator out, TUnaryPredicate predicate) A combination of copy_if and copy_n ____________________________________________________________________________________________________ reverse_copy template TIterator2 reverse_copy(TIterator1 sb, TIterator1 se, TIterator2 db) Copies the elements from the range sb, se to another range beginning at db in such a way that the elements in the new range are in reverse order. https://en.cppreference.com/w/cpp/algorithm/reverse_copy Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The STL is not in use. ____________________________________________________________________________________________________ copy_backward template TIterator2 copy_backward(TIterator1 sb, TIterator1 se, TIterator2 de) Copies the elements from the range, defined by sb, se to another range ending at db The elements are copied in reverse order. https://en.cppreference.com/w/cpp/algorithm/copy_backward Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The STL is not in use. ____________________________________________________________________________________________________ count template typename iterator_traits::difference_type count(TIterator first, TIterator last, const T& value) Counts the elements that are equal to value https://en.cppreference.com/w/cpp/algorithm/count ____________________________________________________________________________________________________ count_if template typename iterator_traits::difference_type count_if(TIterator first, TIterator last, TUnaryPredicate predicate) Counts the elements where predicate returns true https://en.cppreference.com/w/cpp/algorithm/count ____________________________________________________________________________________________________ equal template bool equal(TIterator1 first1, TIterator1 last1, TIterator2 first2) Returns true if the range first1, last1 is equal to the range first2, first2 + distance(first1, last1) https://en.cppreference.com/w/cpp/algorithm/equal ____________________________________________________________________________________________________ lexicographical_compare template bool lexicographical_compare(TIterator1 first1, TIterator1 last1, TIterator2 first2, TIterator2 last2) Checks if the range first1, last1 is lexicographically less than the range first2, last2, using the 'less-than' operator ____________________________________________________________________________________________________ template bool lexicographical_compare(TIterator1 first1, TIterator1 last1, TIterator2 first2, TIterator2 last2, TCompare compare) Checks if the range first1, last1 is lexicographically less than the range first2, last2, using compare https://en.cppreference.com/w/cpp/algorithm/lexicographical_compare ____________________________________________________________________________________________________ heap Heap control functions Make Heap template void make_heap(TIterator first, TIterator last) template void make_heap(TIterator first, TIterator last, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/make_heap ____________________________________________________________________________________________________ Is Heap template bool is_heap(TIterator first, TIterator last) template bool is_heap(TIterator first, TIterator last, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/is_heap ____________________________________________________________________________________________________ Pop Heap template void pop_heap(TIterator first, TIterator last) template void pop_heap(TIterator first, TIterator last, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/pop_heap ____________________________________________________________________________________________________ Push Heap template void push_heap(TIterator first, TIterator last) template void push_heap(TIterator first, TIterator last, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/push_heap ____________________________________________________________________________________________________ min template ETL_CONSTEXPR const T& min(const T& a, const T& b) Returns the minimum of the two values ____________________________________________________________________________________________________ template ETL_CONSTEXPR const T& min(const T& a, const T& b, TCompare compare) Returns the value where compare returns true if a is less than b https://en.cppreference.com/w/cpp/algorithm/min ____________________________________________________________________________________________________ max template ETL_CONSTEXPR const T& max(const T& a, const T& b) Returns the maximum of the two values ____________________________________________________________________________________________________ template ETL_CONSTEXPR const T& max(const T& a, const T& b, TCompare compare) Returns the value where compare returns true if a is less than b https://en.cppreference.com/w/cpp/algorithm/max ____________________________________________________________________________________________________ minmax template pair minmax(const T& a, const T& b) Returns the lesser and greater values ____________________________________________________________________________________________________ template pair minmax(const T& a, const T& b, TCompare compare) Returns the lesser and greater values using compare https://en.cppreference.com/w/cpp/algorithm/minmax ____________________________________________________________________________________________________ min_element template TIterator min_element(TIterator begin, TIterator end) Finds the smallest element in the range begin, end ____________________________________________________________________________________________________ template TIterator min_element(TIterator begin, TIterator end, TCompare compare) Finds the smallest element in the range begin, end using compare https://en.cppreference.com/w/cpp/algorithm/min_element ____________________________________________________________________________________________________ max_element template TIterator max_element(TIterator begin, TIterator end) Finds the greatest element in the range begin, end ____________________________________________________________________________________________________ template TIterator max_element(TIterator begin, TIterator end, TCompare compare) Finds the greatest element in the range begin, end using compare https://en.cppreference.com/w/cpp/algorithm/max_element ____________________________________________________________________________________________________ minmax_element template pair minmax_element(TIterator begin, TIterator end) Finds the smallest and greatest element in the range begin, end ____________________________________________________________________________________________________ template pair minmax_element(TIterator begin, TIterator end, TCompare compare) Finds the smallest and greatest element in the range begin, end using compare https://en.cppreference.com/w/cpp/algorithm/minmax_element ____________________________________________________________________________________________________ multimin multimin_compare multimin_iter multimin_iter_compare ETL extension C++11 only Variadic functions to return the minimum value, or iterator to value, from a variable length parameter list. template constexpr const T& multimin(const T& t, const Tx&... tx) ____________________________________________________________________________________________________ template constexpr const T& multimin_compare(TCompare compare, const T& t, const Tx&... tx) ____________________________________________________________________________________________________ template constexpr const TIterator& multimin_iter(const TIterator& t, const TIteratorx&... tx) ____________________________________________________________________________________________________ template constexpr const TIterator& multimin_iter_compare(TCompare compare, const TIterator& t, const TIteratorx&... tx) ____________________________________________________________________________________________________ Example int minimum; minimum = etl::multimin(1, 2, 3, 4, 5, 6, 7, 8)); minimum = etl::multimin_compare(std::less(), 1, 2, 3, 4, 5, 6, 7, 8)); minimum = etl::multimin_compare(std::greater(), 1, 2, 3, 4, 5, 6, 7, 8)); int i[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; int* p_minimum; p_minimum = etl::multimin_iter(&i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7])); p_minimum = etl::multimin_iter_compare(std::less(), &i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7])); p_minimum = etl::multimin_iter_compare(std::greater(), &i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7])); ____________________________________________________________________________________________________ multimax multimax_compare multimax_iter multimax_iter_compare ETL extension C++11 only variadic functions to return the maximum value, or iterator to value, from a variable length parameter list. template constexpr const T& multimax(const T& t, const Tx&... tx) ____________________________________________________________________________________________________ template constexpr const T& multimax_compare(TCompare compare, const T& t, const Tx&... tx) ____________________________________________________________________________________________________ template constexpr const TIterator& multimax_iter(const TIterator& t, const TIteratorx&... tx) ____________________________________________________________________________________________________ template constexpr const TIterator& multimax_iter_compare(TCompare compare, const TIterator& t, const TIteratorx&... tx) ____________________________________________________________________________________________________ Example int maximum; maximum = etl::multimax(1, 2, 3, 4, 5, 6, 7, 8)); maximum = etl::multimax_compare(std::less(), 1, 2, 3, 4, 5, 6, 7, 8)); maximum = etl::multimax_compare(std::greater(), 1, 2, 3, 4, 5, 6, 7, 8)); int i[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; int* p_maximum; p_maximum = etl::multimax_iter(&i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7])); p_maximum = etl::multimax_iter_compare(std::less(), &i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7])); p_maximum = etl::multimax_iter_compare(std::greater(), &i[0], &i[1], &i[2], &i[3], &i[4], &i[5], &i[6], &i[7])); ____________________________________________________________________________________________________ move template TIterator2 move(TIterator1 sb, TIterator1 se, TIterator2 db) Moves the elements in the range sb, se to another range beginning at db https://en.cppreference.com/w/cpp/algorithm/move Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ move_s ETL extension template TOutputIterator move_s(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end) A safer four parameter version that will stop moving when either iterator reaches the end of its range. Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ move_backward template TIterator2 move_backward(TIterator1 sb, TIterator1 se, TIterator2 de) Moves the elements in the range sb, se to another range ending at de The elements are moved in reverse order https://en.cppreference.com/w/cpp/algorithm/move_backward Constexpr This function is constexpr under the following conditions. ⦁ The STL is in use and C++20 is supported. ⦁ The iterator is non-pointer or the type is not trivially copyable and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, built-in memcpy is supports, and C++14 is supported. ⦁ The iterator is a pointer, the type is trivially copyable, ETL_FORCE_CONSTEXPR_ALGORITHMS is defined as 1, and C++14 is supported. ____________________________________________________________________________________________________ reverse template void reverse(TIterator b, TIterator e) Reverses the order of the elements in the range b, e https://en.cppreference.com/w/cpp/algorithm/reverse ____________________________________________________________________________________________________ for_each_if ETL extension template TUnaryFunction for_each_if(TIterator begin, const TIterator end, TUnaryFunction function, TUnaryPredicate predicate) Applies function to each element if predicate returns true ____________________________________________________________________________________________________ for_each_n ETL extension template TIterator for_each_n(TIterator begin, TSize n, TUnaryFunction function) Applies function to n elements, starting from begin ____________________________________________________________________________________________________ for_each_n_if ETL extension template TIterator for_each_n_if(TIterator begin, TSize n, TUnaryFunction function, TUnaryPredicate predicate) Combination of for_each_if and for_each_n ____________________________________________________________________________________________________ fill template void fill(TIterator first, TIterator last, const TValue& value) Assigns the given value to the elements in the range first, last https://en.cppreference.com/w/cpp/algorithm/fill ____________________________________________________________________________________________________ fill_n template TIterator fill_n(TIterator first, TSize count, const TValue& value) Assigns the given value to the first count elements in the range beginning at first https://en.cppreference.com/w/cpp/algorithm/fill_n ____________________________________________________________________________________________________ find template TIterator find(TIterator first, TIterator last, const T& value) Searches for an element equal to value https://en.cppreference.com/w/cpp/algorithm/find ____________________________________________________________________________________________________ find_end Searches for the last occurrence of the sequence b, e in the range sb, be template TIterator1 find_end(TIterator1 b, TIterator1 e, TIterator2 sb, TIterator2 se) ____________________________________________________________________________________________________ template TIterator1 find_end(TIterator1 b, TIterator1 e, TIterator2 sb, TIterator2 se, TPredicate predicate) https://en.cppreference.com/w/cpp/algorithm/find_end ____________________________________________________________________________________________________ find_if template TIterator find_if(TIterator first, TIterator last, TUnaryPredicate predicate) Searches for the first element that satisfies the predicate https://en.cppreference.com/w/cpp/algorithm/find ____________________________________________________________________________________________________ find_if_not template TIterator find_if_not(TIterator begin, TIterator end, TUnaryPredicate predicate) Searches for the first element that does not satisfy the predicate https://en.cppreference.com/w/cpp/algorithm/find ____________________________________________________________________________________________________ lower_bound template TIterator lower_bound(TIterator first, TIterator last, const TValue& value) ____________________________________________________________________________________________________ template TIterator lower_bound(TIterator first, TIterator last, const TValue& value, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/lower_bound ____________________________________________________________________________________________________ upper_bound template TIterator upper_bound(TIterator first, TIterator last, const TValue& value) ____________________________________________________________________________________________________ template TIterator upper_bound(TIterator first, TIterator last, const TValue& value, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/upper_bound ____________________________________________________________________________________________________ equal_range template pair equal_range(TIterator first, TIterator last, const TValue& value) Returns an iterator pointing to the first element in the range first, last that is not less than value, or last if no such element is found. ____________________________________________________________________________________________________ template pair equal_range(TIterator first, TIterator last, const TValue& value, TCompare compare) Returns an iterator pointing to the first element in the range first, last that is not less than value using compare, or last if no such element is found. https://en.cppreference.com/w/cpp/algorithm/equal_range ____________________________________________________________________________________________________ binary_find ETL extension template TIterator binary_find(TIterator begin, TIterator end, const TValue& value) Finds the first item in a sorted container that matches the value. Returns an iterator to the value or end. ____________________________________________________________________________________________________ ETL extension template TIterator binary_find(TIterator begin, TIterator end, const TValue& value, TBinaryPredicate predicate, TBinaryEquality equality) Finds the first item in a sorted container that matches the value. Returns an iterator to the value or end. Comparison and equality predicates are supplied. ____________________________________________________________________________________________________ search template TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last) Searches for the first occurrence of the sequence of elements first, last in the range search_first, search_last ____________________________________________________________________________________________________ template TIterator1 search(TIterator1 first, TIterator1 last, TIterator2 search_first, TIterator2 search_last, TCompare compare) Searches for the first occurrence of the sequence of elements first, last in the range search_first, search_last Uses compare to check equality of the values https://en.cppreference.com/w/cpp/algorithm/search ____________________________________________________________________________________________________ binary_search template bool binary_search(TIterator first, TIterator last, const T& value, Compare compare) template bool binary_search(TIterator first, TIterator last, const T& value) https://en.cppreference.com/w/cpp/algorithm/binary_search ____________________________________________________________________________________________________ all_of template bool all_of(TIterator begin, TIterator end, TUnaryPredicate predicate) Checks if predicate returns true for all elements in the range begin, end https://en.cppreference.com/w/cpp/algorithm/all_any_none_of ____________________________________________________________________________________________________ any_of template bool any_of(TIterator begin, TIterator end, TUnaryPredicate predicate) Checks if predicate returns true for at least one element in the range begin, end https://en.cppreference.com/w/cpp/algorithm/all_any_none_of ____________________________________________________________________________________________________ none_of template bool none_of(TIterator begin, TIterator end, TUnaryPredicate predicate) Checks if predicate returns true for no elements in the range begin, end https://en.cppreference.com/w/cpp/algorithm/all_any_none_of ____________________________________________________________________________________________________ is_permutation Returns true if there exists a permutation of the elements in the range begin1, end1 that makes that range equal to the second range template bool is_permutation(TIterator1 begin1, TIterator1 end1, TIterator2 begin2) ____________________________________________________________________________________________________ template bool is_permutation(TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TIterator2 end2) ____________________________________________________________________________________________________ template bool is_permutation(TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TBinaryPredicate predicate) ____________________________________________________________________________________________________ template bool is_permutation(TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TIterator2 end2, TBinaryPredicate predicate) https://en.cppreference.com/w/cpp/algorithm/is_permutation ____________________________________________________________________________________________________ is_partitioned template bool is_partitioned(TIterator begin, TIterator end, TUnaryPredicate predicate) Returns true if all elements in the range begin, end that satisfy the predicate appear before all elements that don't. Also returns true if begin, end is empty. https://en.cppreference.com/w/cpp/algorithm/is_partitioned ____________________________________________________________________________________________________ partition_point template TIterator partition_point(TIterator begin, TIterator end, TUnaryPredicate predicate) Examines the partitioned range begin, end and locates the end of the first partition according to predicate https://en.cppreference.com/w/cpp/algorithm/partition_point ____________________________________________________________________________________________________ partition_copy template pair partition_copy(TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, TUnaryPredicate predicate) Copies the elements from the range begin, end to two different ranges depending on the value returned by the predicate. The elements that satisfy the predicate p are copied to the range beginning at destination_true. The rest of the elements are copied to the range beginning at destination_false. https://en.cppreference.com/w/cpp/algorithm/partition_copy ____________________________________________________________________________________________________ partition_transform ETL extension Transforms data from the source to one of two destinations. If the predicate returns true then the source data if modified by function_true and stored in destination_true. If the predicate returns false then the source data if modified by function_false and stored in destination_false. One input range. template pair partition_transform(TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, TUnaryFunctionTrue function_true, TUnaryFunctionFalse function_false, TUnaryPredicate predicate) ____________________________________________________________________________________________________ Two input ranges. template pair partition_transform(TSource1 begin1, TSource1 end1, TSource2 begin2, TDestinationTrue destination_true, TDestinationFalse destination_false, TBinaryFunctionTrue function_true, TBinaryFunctionFalse function_false, TBinaryPredicate predicate) ____________________________________________________________________________________________________ rotate template TIterator rotate(TIterator first, TIterator middle, TIterator last) Performs a left rotation on the range of elements https://en.cppreference.com/w/cpp/algorithm/rotate ____________________________________________________________________________________________________ transform_s ETL extension A safer version that will stop transforming when either iterator reaches the end of its range. template void transform_s(TIterator i_begin, TIterator i_end, TOutputIterator o_begin, TOutputIterator o_end, TUnaryFunction function) ____________________________________________________________________________________________________ transform_n ETL extension Transform over n elements One input range. template void transform_n(TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryFunction function) ____________________________________________________________________________________________________ Two input ranges. template void transform_n(TInputIterator1 i_begin1, TInputIterator2 i_begin2, TSize n, TOutputIterator o_begin, TBinaryFunction function) ____________________________________________________________________________________________________ transform_if ETL extension Transforms data from the source based on a predicate. If the predicate returns true then the source data if modified by function and stored in the output range. If the predicate returns false then the source data is ignored. One input range. template TOutputIterator transform_if(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TUnaryFunction function, TUnaryPredicate predicate) ____________________________________________________________________________________________________ Two input ranges. template TOutputIterator transform_if(TInputIterator1 i_begin1, TInputIterator1 i_end1, TInputIterator2 i_begin2, TOutputIterator o_begin, TBinaryFunction function, TBinaryPredicate predicate) ____________________________________________________________________________________________________ transform_n_if ETL extension Transforms data from the source based on a predicate for 'n' items. If the predicate returns true then the source data if modified by function and stored in the output range. If the predicate returns false then the source data is ignored. One input range. template TOutputIterator transform_if(TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryFunction function, TUnaryPredicate predicate) ____________________________________________________________________________________________________ Two input ranges. template TOutputIterator transform_if(TInputIterator1 i_begin1, TSize n, TInputIterator2 i_begin2, TOutputIterator o_begin, TBinaryFunction function, TBinaryPredicate predicate) ____________________________________________________________________________________________________ shell_sort ETL extension Sorts a range using the shell sort algorithm. template void shell_sort(TIterator first, TIterator last) ____________________________________________________________________________________________________ template void shell_sort(TIterator first, TIterator last, TCompare compare) https://en.wikipedia.org/wiki/Shellsort ____________________________________________________________________________________________________ insertion_sort ETL extension Sorts a range using the insertion sort algorithm. template void insertion_sort(TIterator first, TIterator last) ____________________________________________________________________________________________________ template void insertion_sort(TIterator first, TIterator last, TCompare compare) https://en.wikipedia.org/wiki/Insertion_sort ____________________________________________________________________________________________________ heap_sort ETL extension 16.2.0 Sorts a range using the heap sort algorithm. template void heap_sort(TIterator first, TIterator last) ____________________________________________________________________________________________________ template void heap_sort(TIterator first, TIterator last, TCompare compare) https://en.wikipedia.org/wiki/Heapsort ____________________________________________________________________________________________________ selection_sort ETL extension 20.7.0 Sorts a range using the selection sort algorithm. template void selection_sort(TIterator first, TIterator last) ____________________________________________________________________________________________________ template void selection_sort(TIterator first, TIterator last, TCompare compare) https://en.wikipedia.org/wiki/Selectionsort ____________________________________________________________________________________________________ sort Sorts a range. template void sort(TIterator first, TIterator last) ____________________________________________________________________________________________________ template void sort(TIterator first, TIterator last, TCompare compare) If ETL_NO_STL is defined then uses etl::shell_sort, otherwise calls std::sort. https://en.cppreference.com/w/cpp/algorithm/sort ____________________________________________________________________________________________________ stable_sort Stable sorts a range. template void stable_sort(TIterator first, TIterator last) ____________________________________________________________________________________________________ template void stable_sort(TIterator first, TIterator last, TCompare compare) If ETL_NO_STL is defined then uses etl::insertion_sort, otherwise calls std::stable_sort. https://en.cppreference.com/w/cpp/algorithm/stable_sort ____________________________________________________________________________________________________ is_sorted Returns true is the range is sorted template bool is_sorted(TIterator begin, TIterator end) ____________________________________________________________________________________________________ template bool is_sorted(TIterator begin, TIterator end, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/is_sorted ____________________________________________________________________________________________________ is_sorted_until Returns an iterator the first element that is not sorted template TIterator is_sorted_until(TIterator begin, TIterator end) ____________________________________________________________________________________________________ template TIterator is_sorted_until(TIterator begin, TIterator end, TCompare compare) https://en.cppreference.com/w/cpp/algorithm/is_sorted_until ____________________________________________________________________________________________________ clamp Clamps a value between two limits. template ETL_CONSTEXPR const T& clamp(const T& value, const T& low, const T& high, TCompare compare) ____________________________________________________________________________________________________ template ETL_CONSTEXPR const T& clamp(const T& value, const T& low, const T& high ) ____________________________________________________________________________________________________ accumulate Reverse engineered std::accumulate template ETL_CONSTEXPR14 T accumulate(TIterator first, TIterator last, T sum) template ETL_CONSTEXPR14 T accumulate(TIterator first, TIterator last, T sum, TBinaryOperation operation) ____________________________________________________________________________________________________ remove template TIterator remove(TIterator first, TIterator last, const T& value) Removes all elements that are equal to value. ____________________________________________________________________________________________________ remove_if template TIterator remove_if(TIterator first, TIterator last, TPredicate predicate) Removes all elements that satisfy the predicate.