Embedded Template Library 1.0
|
Including reverse engineered algorithms from C++ 0x11, 0x14, 0x17 Additional new variants of certain algorithms.
ETL_CONSTEXPR14 T etl::accumulate | ( | TIterator | first, |
TIterator | last, | ||
T | sum, | ||
TBinaryOperation | operation | ||
) |
Accumulates values.
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">
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">
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.
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 values.
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">
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.
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.
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.
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.
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.
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. |
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">
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.
ETL_CONSTEXPR14 TIterator etl::for_each_n | ( | TIterator | begin, |
TSize | n, | ||
TUnaryFunction | function | ||
) |
Like std::for_each but for 'n' iterations.
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
Sorts the elements using heap sort.
Sorts the elements using heap sort. Uses user defined comparison.
Sorts the elements using insertion sort.
Sorts the elements using insertion sort. Uses user defined comparison.
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">
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">
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">
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">
ETL_NODISCARD 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
a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted">
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
a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted_until">
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">
max_element
a href="http://en.cppreference.com/w/cpp/algorithm/max_element">
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">
min_element
a href="http://en.cppreference.com/w/cpp/algorithm/min_element">
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">
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">
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">
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">
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">
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.
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. |
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">
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">
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">
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 the elements from the range (begin, end) to two different ranges depending on the value returned by the predicate.
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 the elements from the ranges (begin1, end1) & (begin2) to two different ranges depending on the value returned by the predicate.
ETL_CONSTEXPR14 TIterator etl::remove_if | ( | TIterator | first, |
TIterator | last, | ||
TUnaryPredicate | predicate | ||
) |
Remove If
Sorts the elements using selection sort.
Sorts the elements using selection sort. Uses user defined comparison.
Sorts the elements using shell sort.
Sorts the elements using shell sort. Uses user defined comparison.
Sorts the elements.
Sorts the elements. Uses user defined comparison.
Sorts the elements. Stable.
Sorts the elements. Stable. Uses user defined comparison.
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.
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.
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.
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.
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.
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.
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.