Loading...
Searching...
No Matches
algorithm

## Functions

template<typename TIterator, typename TCompare>
ETL_CONSTEXPR14 void | etl::partial_sort (TIterator first, TIterator middle, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR14 void | etl::partial_sort (TIterator first, TIterator middle, TIterator last)
template<typename TInputIterator, typename TRandomAccessIterator, typename TCompare>
ETL_CONSTEXPR14 TRandomAccessIterator | etl::partial_sort_copy (TInputIterator first, TInputIterator last, TRandomAccessIterator d_first, TRandomAccessIterator d_last, TCompare compare)
template<typename TInputIterator, typename TRandomAccessIterator>
ETL_CONSTEXPR14 TRandomAccessIterator | etl::partial_sort_copy (TInputIterator first, TInputIterator last, TRandomAccessIterator d_first, TRandomAccessIterator d_last)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::min_element (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::min_element (TIterator begin, TIterator end)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::max_element (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::max_element (TIterator begin, TIterator end)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< TIterator, TIterator > | etl::minmax_element (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< TIterator, TIterator > | etl::minmax_element (TIterator begin, TIterator end)
template<typename T>
ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< const T &, const T & > | etl::minmax (const T &a, const T &b)
template<typename T, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< const T &, const T & > | etl::minmax (const T &a, const T &b, TCompare compare)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::is_sorted_until (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::is_sorted_until (TIterator begin, TIterator end)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_sorted (TIterator begin, TIterator end)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_sorted (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::is_unique_sorted_until (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::is_unique_sorted_until (TIterator begin, TIterator end)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_unique_sorted (TIterator begin, TIterator end)
template<typename TIterator, typename TCompare>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_unique_sorted (TIterator begin, TIterator end, TCompare compare)
template<typename TIterator, typename TUnaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::find_if_not (TIterator begin, TIterator end, TUnaryPredicate predicate)
template<typename TIterator, typename TBinaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::adjacent_find (TIterator first, TIterator last, TBinaryPredicate predicate)
template<typename TIterator>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::adjacent_find (TIterator first, TIterator last)
template<typename TIterator1, typename TIterator2>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2)
template<typename TIterator1, typename TIterator2, typename TBinaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TBinaryPredicate predicate)
template<typename TIterator1, typename TIterator2>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TIterator2 end2)
template<typename TIterator1, typename TIterator2, typename TBinaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TIterator2 end2, TBinaryPredicate predicate)
template<typename TIterator, typename TCompare>
ETL_CONSTEXPR14 bool | etl::next_permutation (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR14 bool | etl::next_permutation (TIterator first, TIterator last)
template<typename TIterator, typename TCompare>
ETL_CONSTEXPR14 bool | etl::prev_permutation (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR14 bool | etl::prev_permutation (TIterator first, TIterator last)
template<typename TIterator, typename TUnaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::is_partitioned (TIterator begin, TIterator end, TUnaryPredicate predicate)
template<typename TIterator, typename TUnaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::partition_point (TIterator begin, TIterator end, TUnaryPredicate predicate)
template<typename TSource, typename TDestinationTrue, typename TDestinationFalse, typename TUnaryPredicate>
ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > | etl::partition_copy (TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, TUnaryPredicate predicate)
template<typename TSource, typename TDestinationTrue, typename TDestinationFalse, typename TUnaryPredicate>
ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > | etl::partition_move (TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, TUnaryPredicate predicate)
template<typename TIterator, typename TOutputIterator, typename TUnaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::copy_if (TIterator begin, TIterator end, TOutputIterator out, TUnaryPredicate predicate)
template<typename TIterator, typename TUnaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::all_of (TIterator begin, TIterator end, TUnaryPredicate predicate)
template<typename TIterator, typename TUnaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::any_of (TIterator begin, TIterator end, TUnaryPredicate predicate)
template<typename TIterator, typename TUnaryPredicate>
ETL_NODISCARD ETL_CONSTEXPR14 bool | etl::none_of (TIterator begin, TIterator end, TUnaryPredicate predicate)
template<typename TIterator, typename TCompare>
void | etl::sort (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
void | etl::sort (TIterator first, TIterator last)
template<typename TIterator, typename TCompare>
void | etl::stable_sort (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
void | etl::stable_sort (TIterator first, TIterator last)
template<typename TIterator, typename T>
ETL_CONSTEXPR14 T | etl::accumulate (TIterator first, TIterator last, T sum)
template<typename TIterator, typename T, typename TBinaryOperation>
ETL_CONSTEXPR14 T | etl::accumulate (TIterator first, TIterator last, T sum, TBinaryOperation operation)
template<typename T, typename TCompare>
ETL_CONSTEXPR T | etl::clamp (const T &value, const T &low, const T &high, TCompare compare)
template<typename TIterator, typename T>
ETL_CONSTEXPR14 TIterator | etl::remove (TIterator first, TIterator last, const T &value)
template<typename TIterator, typename TUnaryPredicate>
ETL_CONSTEXPR14 TIterator | etl::remove_if (TIterator first, TIterator last, TUnaryPredicate predicate)
template<typename TIterator>
ETL_CONSTEXPR14 TIterator | etl::unique (TIterator first, TIterator last)
template<typename TIterator, typename TBinaryPredicate>
ETL_CONSTEXPR14 TIterator | etl::unique (TIterator first, TIterator last, TBinaryPredicate predicate)
template<typename TInputIterator, typename TOutputIterator>
ETL_CONSTEXPR14 TOutputIterator | etl::unique_copy (TInputIterator first, TInputIterator last, TOutputIterator d_first)
template<typename TInputIterator, typename TOutputIterator, typename TBinaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::unique_copy (TInputIterator first, TInputIterator last, TOutputIterator d_first, TBinaryPredicate predicate)
template<typename TInputIterator1, typename TInputIterator2, typename TOutputIterator, typename TCompare>
ETL_CONSTEXPR14 TOutputIterator | etl::merge (TInputIterator1 first1, TInputIterator1 last1, TInputIterator2 first2, TInputIterator2 last2, TOutputIterator d_first, TCompare compare)
template<typename TInputIterator1, typename TInputIterator2, typename TOutputIterator>
ETL_CONSTEXPR14 TOutputIterator | etl::merge (TInputIterator1 first1, TInputIterator1 last1, TInputIterator2 first2, TInputIterator2 last2, TOutputIterator d_first)
template<typename TBidirectionalIterator, typename TCompare>
void | etl::inplace_merge (TBidirectionalIterator first, TBidirectionalIterator middle, TBidirectionalIterator last, TCompare compare)
template<typename TBidirectionalIterator>
void | etl::inplace_merge (TBidirectionalIterator first, TBidirectionalIterator middle, TBidirectionalIterator last)
template<typename TInputIterator, typename TOutputIterator>
ETL_CONSTEXPR14 etl::enable_if< etl::is_random_iterator< TInputIterator >::value &&etl::is_random_iterator< TOutputIterator >::value, TOutputIterator >::type | etl::copy_s (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end)
template<typename TInputIterator, typename TSize, typename TOutputIterator>
ETL_CONSTEXPR14 TOutputIterator | etl::copy_n_s (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TOutputIterator o_end)
template<typename TInputIterator, typename TSize1, typename TOutputIterator, typename TSize2>
ETL_CONSTEXPR14 TOutputIterator | etl::copy_n_s (TInputIterator i_begin, TSize1 n1, TOutputIterator o_begin, TSize2 n2)
template<typename TInputIterator, typename TOutputIterator, typename TUnaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::copy_if_s (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end, TUnaryPredicate predicate)
template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TUnaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::copy_n_if (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryPredicate predicate)
template<typename TInputIterator, typename TOutputIterator>
TOutputIterator | etl::move_s (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end)
template<typename TIterator, typename TValue>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::binary_find (TIterator begin, TIterator end, const TValue &value)
template<typename TIterator, typename TValue, typename TBinaryPredicate, typename TBinaryEquality>
ETL_NODISCARD ETL_CONSTEXPR14 TIterator | etl::binary_find (TIterator begin, TIterator end, const TValue &value, TBinaryPredicate predicate, TBinaryEquality equality)
template<typename TIterator, typename TUnaryFunction, typename TUnaryPredicate>
ETL_CONSTEXPR14 TUnaryFunction | etl::for_each_if (TIterator begin, const TIterator end, TUnaryFunction function, TUnaryPredicate predicate)
template<typename TIterator, typename TSize, typename TUnaryFunction>
ETL_CONSTEXPR14 TIterator | etl::for_each_n (TIterator begin, TSize n, TUnaryFunction function)
template<typename TIterator, typename TSize, typename TUnaryFunction, typename TUnaryPredicate>
ETL_CONSTEXPR14 TIterator | etl::for_each_n_if (TIterator begin, TSize n, TUnaryFunction function, TUnaryPredicate predicate)
template<typename TInputIterator, typename TOutputIterator, typename TUnaryFunction>
ETL_CONSTEXPR14 TOutputIterator | etl::transform_s (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end, TUnaryFunction function)
template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TUnaryFunction>
ETL_CONSTEXPR14 void | etl::transform_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryFunction function)
template<typename TInputIterator1, typename TInputIterator2, typename TSize, typename TOutputIterator, typename TBinaryFunction>
ETL_CONSTEXPR14 void | etl::transform_n (TInputIterator1 i_begin1, TInputIterator2 i_begin2, TSize n, TOutputIterator o_begin, TBinaryFunction function)
template<typename TInputIterator, typename TOutputIterator, typename TUnaryFunction, typename TUnaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::transform_if (TInputIterator i_begin, const TInputIterator i_end, TOutputIterator o_begin, TUnaryFunction function, TUnaryPredicate predicate)
template<typename TInputIterator1, typename TInputIterator2, typename TOutputIterator, typename TBinaryFunction, typename TBinaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::transform_if (TInputIterator1 i_begin1, const TInputIterator1 i_end1, TInputIterator2 i_begin2, TOutputIterator o_begin, TBinaryFunction function, TBinaryPredicate predicate)
template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TUnaryFunction, typename TUnaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::transform_n_if (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryFunction function, TUnaryPredicate predicate)
template<typename TInputIterator1, typename TInputIterator2, typename TSize, typename TOutputIterator, typename TBinaryFunction, typename TBinaryPredicate>
ETL_CONSTEXPR14 TOutputIterator | etl::transform_n_if (TInputIterator1 i_begin1, TInputIterator2 i_begin2, TSize n, TOutputIterator o_begin, TBinaryFunction function, TBinaryPredicate predicate)
template<typename TSource, typename TDestinationTrue, typename TDestinationFalse, typename TUnaryFunctionTrue, typename TUnaryFunctionFalse, typename TUnaryPredicate>
ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > | etl::partition_transform (TSource begin, TSource end, TDestinationTrue destination_true, TDestinationFalse destination_false, TUnaryFunctionTrue function_true, TUnaryFunctionFalse function_false, TUnaryPredicate predicate)
template<typename TSource1, typename TSource2, typename TDestinationTrue, typename TDestinationFalse, typename TBinaryFunctionTrue, typename TBinaryFunctionFalse, typename TBinaryPredicate>
ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > | etl::partition_transform (TSource1 begin1, TSource1 end1, TSource2 begin2, TDestinationTrue destination_true, TDestinationFalse destination_false, TBinaryFunctionTrue function_true, TBinaryFunctionFalse function_false, TBinaryPredicate predicate)
template<typename TIterator, typename TCompare>
ETL_CONSTEXPR20 void | etl::shell_sort (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR20 void | etl::shell_sort (TIterator first, TIterator last)
template<typename TIterator, typename TCompare>
ETL_CONSTEXPR14 void | etl::insertion_sort (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR14 void | etl::insertion_sort (TIterator first, TIterator last)
template<typename TIterator, typename TCompare>
ETL_CONSTEXPR20 void | etl::selection_sort (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR20 void | etl::selection_sort (TIterator first, TIterator last)
template<typename TIterator, typename TCompare>
ETL_CONSTEXPR14 void | etl::heap_sort (TIterator first, TIterator last, TCompare compare)
template<typename TIterator>
ETL_CONSTEXPR14 void | etl::heap_sort (TIterator first, TIterator last)

## Detailed Description

Including reverse engineered algorithms from C++11, 14, 17 Additional new variants of certain algorithms.

## Function Documentation

## accumulate() [1/2]

template<typename TIterator, typename T>

ETL_CONSTEXPR14 T etl::accumulate | ( | TIterator | first,
|  | TIterator | last,
|  | T | sum )

Accumulates values.

## accumulate() [2/2]

template<typename TIterator, typename T, typename TBinaryOperation>

ETL_CONSTEXPR14 T etl::accumulate | ( | TIterator | first,
|  | TIterator | last,
|  | T | sum,
|  | TBinaryOperation | operation )

Accumulates values.

## adjacent_find() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::adjacent_find | ( | TIterator | first,
|  | TIterator | last )

adjacent_find

a href="http://en.cppreference.com/w/cpp/algorithm/adjacent_find">

## adjacent_find() [2/2]

template<typename TIterator, typename TBinaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::adjacent_find | ( | TIterator | first,
|  | TIterator | last,
|  | TBinaryPredicate | predicate )

adjacent_find

a href="http://en.cppreference.com/w/cpp/algorithm/adjacent_find">

## all_of()

template<typename TIterator, typename TUnaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::all_of | ( | TIterator | begin,
|  | TIterator | end,
|  | TUnaryPredicate | predicate )

all_of

a href="http://en.cppreference.com/w/cpp/algorithm/all_any_none_of">

## any_of()

template<typename TIterator, typename TUnaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::any_of | ( | TIterator | begin,
|  | TIterator | end,
|  | TUnaryPredicate | predicate )

any_of

a href="http://en.cppreference.com/w/cpp/algorithm/all_any_none_of">

## binary_find() [1/2]

template<typename TIterator, typename TValue>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::binary_find | ( | TIterator | begin,
|  | TIterator | end,
|  | const TValue & | value )

binary_find

Does a binary search and returns an iterator to the value or end if not found.

## binary_find() [2/2]

template<typename TIterator, typename TValue, typename TBinaryPredicate, typename TBinaryEquality>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::binary_find | ( | TIterator | begin,
|  | TIterator | end,
|  | const TValue & | value,
|  | TBinaryPredicate | predicate,
|  | TBinaryEquality | equality )

binary_find

Does a binary search and returns an iterator to the value or end if not found.

## clamp()

template<typename T, typename TCompare>

ETL_CONSTEXPR T etl::clamp | ( | const T & | value,
|  | const T & | low,
|  | const T & | high,
|  | TCompare | compare )

Clamp values.

## copy_if()

template<typename TIterator, typename TOutputIterator, typename TUnaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::copy_if | ( | TIterator | begin,
|  | TIterator | end,
|  | TOutputIterator | out,
|  | TUnaryPredicate | predicate )

copy_if

a href="http://en.cppreference.com/w/cpp/algorithm/copy">

## copy_if_s()

template<typename TInputIterator, typename TOutputIterator, typename TUnaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::copy_if_s | ( | TInputIterator | i_begin,
|  | TInputIterator | i_end,
|  | TOutputIterator | o_begin,
|  | TOutputIterator | o_end,
|  | TUnaryPredicate | predicate )

copy_if A safer form of copy_if where it terminates when the first end iterator is reached. There is currently no STL equivalent.

## copy_n_if()

template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TUnaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::copy_n_if | ( | TInputIterator | i_begin,
|  | TSize | n,
|  | TOutputIterator | o_begin,
|  | TUnaryPredicate | predicate )

copy_n_if Combination of copy_n and copy_if.

## copy_n_s() [1/2]

template<typename TInputIterator, typename TSize, typename TOutputIterator>

ETL_CONSTEXPR14 TOutputIterator etl::copy_n_s | ( | TInputIterator | i_begin,
|  | TSize | n,
|  | TOutputIterator | o_begin,
|  | TOutputIterator | o_end )

copy_n A safer form of copy_n where the smallest of the two ranges is used.

## copy_n_s() [2/2]

template<typename TInputIterator, typename TSize1, typename TOutputIterator, typename TSize2>

ETL_CONSTEXPR14 TOutputIterator etl::copy_n_s | ( | TInputIterator | i_begin,
|  | TSize1 | n1,
|  | TOutputIterator | o_begin,
|  | TSize2 | n2 )

copy_n A safer form of copy_n where the smallest of the two ranges is used.

## copy_s()

template<typename TInputIterator, typename TOutputIterator>

ETL_CONSTEXPR14 etl::enable_if< etl::is_random_iterator< TInputIterator >::value &&etl::is_random_iterator< TOutputIterator >::value, TOutputIterator >::type etl::copy_s | ( | TInputIterator | i_begin,
|  | TInputIterator | i_end,
|  | TOutputIterator | o_begin,
|  | TOutputIterator | o_end )

copy_s A safer form of copy where the smallest of the two ranges is used. There is currently no STL equivalent. Specialisation for random access iterators.

Parameters

  i_begin | Beginning of the input range.
  i_end | End of the input range.
  o_begin | Beginning of the output range.
  o_end | End of the output range.

## find_if_not()

template<typename TIterator, typename TUnaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::find_if_not | ( | TIterator | begin,
|  | TIterator | end,
|  | TUnaryPredicate | predicate )

find_if_not

a href="http://en.cppreference.com/w/cpp/algorithm/find">

## for_each_if()

template<typename TIterator, typename TUnaryFunction, typename TUnaryPredicate>

ETL_CONSTEXPR14 TUnaryFunction etl::for_each_if | ( | TIterator | begin,
|  | const TIterator | end,
|  | TUnaryFunction | function,
|  | TUnaryPredicate | predicate )

Like std::for_each but applies a predicate before calling the function.

## for_each_n()

template<typename TIterator, typename TSize, typename TUnaryFunction>

ETL_CONSTEXPR14 TIterator etl::for_each_n | ( | TIterator | begin,
|  | TSize | n,
|  | TUnaryFunction | function )

Like std::for_each but for 'n' iterations.

## for_each_n_if()

template<typename TIterator, typename TSize, typename TUnaryFunction, typename TUnaryPredicate>

ETL_CONSTEXPR14 TIterator etl::for_each_n_if | ( | TIterator | begin,
|  | TSize | n,
|  | TUnaryFunction | function,
|  | TUnaryPredicate | predicate )

Like std::for_each but applies a predicate before calling the function, for 'n' iterations

## heap_sort() [1/2]

template<typename TIterator>

ETL_CONSTEXPR14 void etl::heap_sort | ( | TIterator | first,
|  | TIterator | last )

Sorts the elements using heap sort.

## heap_sort() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR14 void etl::heap_sort | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

Sorts the elements using heap sort. Uses user defined comparison.

## inplace_merge() [1/2]

template<typename TBidirectionalIterator>

void etl::inplace_merge | ( | TBidirectionalIterator | first,
|  | TBidirectionalIterator | middle,
|  | TBidirectionalIterator | last )

inplace_merge Merges two consecutive sorted ranges [first, middle) and [middle, last) into one sorted range [first, last) in-place. Uses operator< for comparison. see https://en.cppreference.com/w/cpp/algorithm/inplace_merge

## inplace_merge() [2/2]

template<typename TBidirectionalIterator, typename TCompare>

void etl::inplace_merge | ( | TBidirectionalIterator | first,
|  | TBidirectionalIterator | middle,
|  | TBidirectionalIterator | last,
|  | TCompare | compare )

inplace_merge Merges two consecutive sorted ranges [first, middle) and [middle, last) into one sorted range [first, last) in-place. Uses an iterative rotate-based algorithm that requires no additional memory, no recursion and no explicit stack, making it safe for deeply embedded targets with constrained stack sizes. Complexity: O(N log N) comparisons, O(N log N) element moves. see https://en.cppreference.com/w/cpp/algorithm/inplace_merge

## insertion_sort() [1/2]

template<typename TIterator>

ETL_CONSTEXPR14 void etl::insertion_sort | ( | TIterator | first,
|  | TIterator | last )

Sorts the elements using insertion sort.

## insertion_sort() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR14 void etl::insertion_sort | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

Sorts the elements using insertion sort. Uses user defined comparison.

## is_partitioned()

template<typename TIterator, typename TUnaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_partitioned | ( | TIterator | begin,
|  | TIterator | end,
|  | TUnaryPredicate | predicate )

is_partitioned

a href="http://en.cppreference.com/w/cpp/algorithm/is_partitioned">

## is_permutation() [1/4]

template<typename TIterator1, typename TIterator2>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_permutation | ( | TIterator1 | begin1,
|  | TIterator1 | end1,
|  | TIterator2 | begin2 )

is_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/is_permutation">

## is_permutation() [2/4]

template<typename TIterator1, typename TIterator2, typename TBinaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_permutation | ( | TIterator1 | begin1,
|  | TIterator1 | end1,
|  | TIterator2 | begin2,
|  | TBinaryPredicate | predicate )

is_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/is_permutation">

## is_permutation() [3/4]

template<typename TIterator1, typename TIterator2>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_permutation | ( | TIterator1 | begin1,
|  | TIterator1 | end1,
|  | TIterator2 | begin2,
|  | TIterator2 | end2 )

is_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/is_permutation">

## is_permutation() [4/4]

template<typename TIterator1, typename TIterator2, typename TBinaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_permutation | ( | TIterator1 | begin1,
|  | TIterator1 | end1,
|  | TIterator2 | begin2,
|  | TIterator2 | end2,
|  | TBinaryPredicate | predicate )

is_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/is_permutation">

## is_sorted() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_sorted | ( | TIterator | begin,
|  | TIterator | end )

is_sorted

a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted">

## is_sorted() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_sorted | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

is_sorted

a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted">

## is_sorted_until() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::is_sorted_until | ( | TIterator | begin,
|  | TIterator | end )

is_sorted_until

a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted_until">

## is_sorted_until() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::is_sorted_until | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

is_sorted_until

a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted_until">

## is_unique_sorted() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_unique_sorted | ( | TIterator | begin,
|  | TIterator | end )

is_unique_sorted

## is_unique_sorted() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::is_unique_sorted | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

is_unique_sorted

## is_unique_sorted_until() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::is_unique_sorted_until | ( | TIterator | begin,
|  | TIterator | end )

is_unique_sorted_until

## is_unique_sorted_until() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::is_unique_sorted_until | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

is_unique_sorted_until

## max_element() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::max_element | ( | TIterator | begin,
|  | TIterator | end )

max_element

a href="http://en.cppreference.com/w/cpp/algorithm/max_element">

## max_element() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::max_element | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

Finds the iterator to the largest element in the range (begin, end).
a href="http://en.cppreference.com/w/cpp/algorithm/max_element">

## merge() [1/2]

template<typename TInputIterator1, typename TInputIterator2, typename TOutputIterator>

ETL_CONSTEXPR14 TOutputIterator etl::merge | ( | TInputIterator1 | first1,
|  | TInputIterator1 | last1,
|  | TInputIterator2 | first2,
|  | TInputIterator2 | last2,
|  | TOutputIterator | d_first )

merge Merges two sorted ranges into one sorted range. Uses operator< for comparison. see https://en.cppreference.com/w/cpp/algorithm/merge

## merge() [2/2]

template<typename TInputIterator1, typename TInputIterator2, typename TOutputIterator, typename TCompare>

ETL_CONSTEXPR14 TOutputIterator etl::merge | ( | TInputIterator1 | first1,
|  | TInputIterator1 | last1,
|  | TInputIterator2 | first2,
|  | TInputIterator2 | last2,
|  | TOutputIterator | d_first,
|  | TCompare | compare )

merge Merges two sorted ranges into one sorted range. see https://en.cppreference.com/w/cpp/algorithm/merge

## min_element() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::min_element | ( | TIterator | begin,
|  | TIterator | end )

min_element

a href="http://en.cppreference.com/w/cpp/algorithm/min_element">

## min_element() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::min_element | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

Finds the iterator to the smallest element in the range (begin, end).
a href="http://en.cppreference.com/w/cpp/algorithm/min_element">

## minmax() [1/2]

template<typename T>

ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< const T &, const T & > etl::minmax | ( | const T & | a,
|  | const T & | b )

minmax

a href="http://en.cppreference.com/w/cpp/algorithm/minmax">

## minmax() [2/2]

template<typename T, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< const T &, const T & > etl::minmax | ( | const T & | a,
|  | const T & | b,
|  | TCompare | compare )

minmax

a href="http://en.cppreference.com/w/cpp/algorithm/minmax">

## minmax_element() [1/2]

template<typename TIterator>

ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< TIterator, TIterator > etl::minmax_element | ( | TIterator | begin,
|  | TIterator | end )

minmax_element

a href="http://en.cppreference.com/w/cpp/algorithm/minmax_element">

## minmax_element() [2/2]

template<typename TIterator, typename TCompare>

ETL_NODISCARD ETL_CONSTEXPR14 ETL_OR_STD::pair< TIterator, TIterator > etl::minmax_element | ( | TIterator | begin,
|  | TIterator | end,
|  | TCompare | compare )

Finds the greatest and the smallest element in the range (begin, end).
a href="http://en.cppreference.com/w/cpp/algorithm/minmax_element">

## move_s()

template<typename TInputIterator, typename TOutputIterator>

TOutputIterator etl::move_s | ( | TInputIterator | i_begin,
|  | TInputIterator | i_end,
|  | TOutputIterator | o_begin,
|  | TOutputIterator | o_end )

move_s C++03 A safer form of move where the smallest of the two ranges is used. There is currently no STL equivalent. Specialisation for non random access iterators.

Parameters

  i_begin | Beginning of the input range.
  i_end | End of the input range.
  o_begin | Beginning of the output range.
  o_end | End of the output range.

## next_permutation() [1/2]

template<typename TIterator>

ETL_CONSTEXPR14 bool etl::next_permutation | ( | TIterator | first,
|  | TIterator | last )

next_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/next_permutation">

## next_permutation() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR14 bool etl::next_permutation | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

next_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/next_permutation">

## none_of()

template<typename TIterator, typename TUnaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 bool etl::none_of | ( | TIterator | begin,
|  | TIterator | end,
|  | TUnaryPredicate | predicate )

none_of

a href="http://en.cppreference.com/w/cpp/algorithm/all_any_none_of">

## partial_sort() [1/2]

template<typename TIterator>

ETL_CONSTEXPR14 void etl::partial_sort | ( | TIterator | first,
|  | TIterator | middle,
|  | TIterator | last )

partial_sort

a href="http://en.cppreference.com/w/cpp/algorithm/partial_sort">

## partial_sort() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR14 void etl::partial_sort | ( | TIterator | first,
|  | TIterator | middle,
|  | TIterator | last,
|  | TCompare | compare )

partial_sort

a href="http://en.cppreference.com/w/cpp/algorithm/partial_sort">

## partial_sort_copy() [1/2]

template<typename TInputIterator, typename TRandomAccessIterator>

ETL_CONSTEXPR14 TRandomAccessIterator etl::partial_sort_copy | ( | TInputIterator | first,
|  | TInputIterator | last,
|  | TRandomAccessIterator | d_first,
|  | TRandomAccessIterator | d_last )

partial_sort_copy

a href="http://en.cppreference.com/w/cpp/algorithm/partial_sort_copy">

## partial_sort_copy() [2/2]

template<typename TInputIterator, typename TRandomAccessIterator, typename TCompare>

ETL_CONSTEXPR14 TRandomAccessIterator etl::partial_sort_copy | ( | TInputIterator | first,
|  | TInputIterator | last,
|  | TRandomAccessIterator | d_first,
|  | TRandomAccessIterator | d_last,
|  | TCompare | compare )

partial_sort_copy

a href="http://en.cppreference.com/w/cpp/algorithm/partial_sort_copy">

## partition_copy()

template<typename TSource, typename TDestinationTrue, typename TDestinationFalse, typename TUnaryPredicate>

ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > etl::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.
a href="http://en.cppreference.com/w/cpp/algorithm/partition_copy">

## partition_move()

template<typename TSource, typename TDestinationTrue, typename TDestinationFalse, typename TUnaryPredicate>

ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > etl::partition_move | ( | TSource | begin,
|  | TSource | end,
|  | TDestinationTrue | destination_true,
|  | TDestinationFalse | destination_false,
|  | TUnaryPredicate | predicate )

Moves the elements from the range (begin, end) to two different ranges depending on the value returned by the predicate.

## partition_point()

template<typename TIterator, typename TUnaryPredicate>

ETL_NODISCARD ETL_CONSTEXPR14 TIterator etl::partition_point | ( | TIterator | begin,
|  | TIterator | end,
|  | TUnaryPredicate | predicate )

partition_point a href="http://en.cppreference.com/w/cpp/algorithm/partition_point">

## partition_transform() [1/2]

template<typename TSource, typename TDestinationTrue, typename TDestinationFalse, typename TUnaryFunctionTrue, typename TUnaryFunctionFalse, typename TUnaryPredicate>

ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > etl::partition_transform | ( | TSource | begin,
|  | TSource | end,
|  | TDestinationTrue | destination_true,
|  | TDestinationFalse | destination_false,
|  | TUnaryFunctionTrue | function_true,
|  | TUnaryFunctionFalse | function_false,
|  | TUnaryPredicate | predicate )

Transforms and copies the elements from the range (begin, end) to two different ranges depending on the value returned by the predicate.

## partition_transform() [2/2]

template<typename TSource1, typename TSource2, typename TDestinationTrue, typename TDestinationFalse, typename TBinaryFunctionTrue, typename TBinaryFunctionFalse, typename TBinaryPredicate>

ETL_CONSTEXPR14 ETL_OR_STD::pair< TDestinationTrue, TDestinationFalse > etl::partition_transform | ( | TSource1 | begin1,
|  | TSource1 | end1,
|  | TSource2 | begin2,
|  | TDestinationTrue | destination_true,
|  | TDestinationFalse | destination_false,
|  | TBinaryFunctionTrue | function_true,
|  | TBinaryFunctionFalse | function_false,
|  | TBinaryPredicate | predicate )

Transforms and copies the elements from the ranges (begin1, end1) & (begin2) to two different ranges depending on the value returned by the predicate.

## prev_permutation() [1/2]

template<typename TIterator>

ETL_CONSTEXPR14 bool etl::prev_permutation | ( | TIterator | first,
|  | TIterator | last )

prev_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/prev_permutation">

## prev_permutation() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR14 bool etl::prev_permutation | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

prev_permutation

a href="http://en.cppreference.com/w/cpp/algorithm/prev_permutation">

## remove()

template<typename TIterator, typename T>

ETL_CONSTEXPR14 TIterator etl::remove | ( | TIterator | first,
|  | TIterator | last,
|  | const T & | value )

Remove

## remove_if()

template<typename TIterator, typename TUnaryPredicate>

ETL_CONSTEXPR14 TIterator etl::remove_if | ( | TIterator | first,
|  | TIterator | last,
|  | TUnaryPredicate | predicate )

Remove If

## selection_sort() [1/2]

template<typename TIterator>

ETL_CONSTEXPR20 void etl::selection_sort | ( | TIterator | first,
|  | TIterator | last )

Sorts the elements using selection sort.

## selection_sort() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR20 void etl::selection_sort | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

Sorts the elements using selection sort. Uses user defined comparison.

## shell_sort() [1/2]

template<typename TIterator>

ETL_CONSTEXPR20 void etl::shell_sort | ( | TIterator | first,
|  | TIterator | last )

Sorts the elements using shell sort.

## shell_sort() [2/2]

template<typename TIterator, typename TCompare>

ETL_CONSTEXPR20 void etl::shell_sort | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

Sorts the elements using shell sort. Uses user defined comparison.

## sort() [1/2]

template<typename TIterator>

void etl::sort | ( | TIterator | first,
|  | TIterator | last )

Sorts the elements.

## sort() [2/2]

template<typename TIterator, typename TCompare>

void etl::sort | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

Sorts the elements. Uses user defined comparison.

## stable_sort() [1/2]

template<typename TIterator>

void etl::stable_sort | ( | TIterator | first,
|  | TIterator | last )

Sorts the elements. Stable.

## stable_sort() [2/2]

template<typename TIterator, typename TCompare>

void etl::stable_sort | ( | TIterator | first,
|  | TIterator | last,
|  | TCompare | compare )

Sorts the elements. Stable. Uses user defined comparison.

## transform_if() [1/2]

template<typename TInputIterator, typename TOutputIterator, typename TUnaryFunction, typename TUnaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::transform_if | ( | TInputIterator | i_begin,
|  | const TInputIterator | i_end,
|  | TOutputIterator | o_begin,
|  | TUnaryFunction | function,
|  | TUnaryPredicate | predicate )

Like std::transform but applies a predicate before calling the function.

## transform_if() [2/2]

template<typename TInputIterator1, typename TInputIterator2, typename TOutputIterator, typename TBinaryFunction, typename TBinaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::transform_if | ( | TInputIterator1 | i_begin1,
|  | const TInputIterator1 | i_end1,
|  | TInputIterator2 | i_begin2,
|  | TOutputIterator | o_begin,
|  | TBinaryFunction | function,
|  | TBinaryPredicate | predicate )

Like etl::transform_if but inputs from two ranges.

## transform_n() [1/2]

template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TUnaryFunction>

ETL_CONSTEXPR14 void etl::transform_n | ( | TInputIterator | i_begin,
|  | TSize | n,
|  | TOutputIterator | o_begin,
|  | TUnaryFunction | function )

Transform 'n' items. Random iterators. There is currently no STL equivalent.

## transform_n() [2/2]

template<typename TInputIterator1, typename TInputIterator2, typename TSize, typename TOutputIterator, typename TBinaryFunction>

ETL_CONSTEXPR14 void etl::transform_n | ( | TInputIterator1 | i_begin1,
|  | TInputIterator2 | i_begin2,
|  | TSize | n,
|  | TOutputIterator | o_begin,
|  | TBinaryFunction | function )

Transform 'n' items from two ranges. Random iterators. There is currently no STL equivalent.

## transform_n_if() [1/2]

template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TUnaryFunction, typename TUnaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::transform_n_if | ( | TInputIterator | i_begin,
|  | TSize | n,
|  | TOutputIterator | o_begin,
|  | TUnaryFunction | function,
|  | TUnaryPredicate | predicate )

Like std::transform_if, for 'n' items.

## transform_n_if() [2/2]

template<typename TInputIterator1, typename TInputIterator2, typename TSize, typename TOutputIterator, typename TBinaryFunction, typename TBinaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::transform_n_if | ( | TInputIterator1 | i_begin1,
|  | TInputIterator2 | i_begin2,
|  | TSize | n,
|  | TOutputIterator | o_begin,
|  | TBinaryFunction | function,
|  | TBinaryPredicate | predicate )

Like etl::transform_if but inputs from two ranges for 'n' items.

## transform_s()

template<typename TInputIterator, typename TOutputIterator, typename TUnaryFunction>

ETL_CONSTEXPR14 TOutputIterator etl::transform_s | ( | TInputIterator | i_begin,
|  | TInputIterator | i_end,
|  | TOutputIterator | o_begin,
|  | TOutputIterator | o_end,
|  | TUnaryFunction | function )

A safer form of std::transform where the transform returns when the first range end is reached. There is currently no STL equivalent.

## unique() [1/2]

template<typename TIterator>

ETL_CONSTEXPR14 TIterator etl::unique | ( | TIterator | first,
|  | TIterator | last )

unique see https://en.cppreference.com/w/cpp/algorithm/unique

## unique() [2/2]

template<typename TIterator, typename TBinaryPredicate>

ETL_CONSTEXPR14 TIterator etl::unique | ( | TIterator | first,
|  | TIterator | last,
|  | TBinaryPredicate | predicate )

unique see https://en.cppreference.com/w/cpp/algorithm/unique predicate overload to determine equality.

## unique_copy() [1/2]

template<typename TInputIterator, typename TOutputIterator>

ETL_CONSTEXPR14 TOutputIterator etl::unique_copy | ( | TInputIterator | first,
|  | TInputIterator | last,
|  | TOutputIterator | d_first )

unique_copy see https://en.cppreference.com/w/cpp/algorithm/unique_copy

## unique_copy() [2/2]

template<typename TInputIterator, typename TOutputIterator, typename TBinaryPredicate>

ETL_CONSTEXPR14 TOutputIterator etl::unique_copy | ( | TInputIterator | first,
|  | TInputIterator | last,
|  | TOutputIterator | d_first,
|  | TBinaryPredicate | predicate )

unique_copy see https://en.cppreference.com/w/cpp/algorithm/unique_copy predicate overload to determine equality.