Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
algorithm.h File Reference
Go to the source code of this file.
Namespaces | |
namespace | etl |
A multimap with the capacity defined at compile time. | |
Functions | |
template<typename TIterator , typename TCompare > | |
std::pair< TIterator, TIterator > | minmax_element (TIterator begin, TIterator end, TCompare compare) |
Finds the greatest and the smallest element in the range (begin, end). | |
template<typename TIterator > | |
std::pair< TIterator, TIterator > | minmax_element (TIterator begin, TIterator end) |
minmax_elementa href="http://en.cppreference.com/w/cpp/algorithm/minmax_element"> | |
template<typename T > | |
std::pair< const T &, const T & > | minmax (const T &a, const T &b) |
minmaxa href="http://en.cppreference.com/w/cpp/algorithm/minmax"> | |
template<typename T , typename TCompare > | |
std::pair< const T &, const T & > | minmax (const T &a, const T &b, TCompare compare) |
minmaxa href="http://en.cppreference.com/w/cpp/algorithm/minmax"> | |
template<typename TIterator > | |
TIterator | is_sorted_until (TIterator begin, TIterator end) |
is_sorted_untila href="http://en.cppreference.com/w/cpp/algorithm/is_sorted_until"> | |
template<typename TIterator , typename TCompare > | |
TIterator | is_sorted_until (TIterator begin, TIterator end, TCompare compare) |
is_sorted_untila href="http://en.cppreference.com/w/cpp/algorithm/is_sorted_until"> | |
template<typename TIterator > | |
bool | is_sorted (TIterator begin, TIterator end) |
is_sorteda href="http://en.cppreference.com/w/cpp/algorithm/is_sorted"> | |
template<typename TIterator , typename TCompare > | |
bool | is_sorted (TIterator begin, TIterator end, TCompare compare) |
is_sorteda href="http://en.cppreference.com/w/cpp/algorithm/is_sorted"> | |
template<typename TInputIterator , typename TOutputIterator > | |
etl::enable_if < etl::is_random_iterator < TInputIterator >::value &&etl::is_random_iterator < TOutputIterator >::value, TOutputIterator >::type | copy (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end) |
copy A form of copy where the smallest of the two ranges is used. | |
template<typename TInputIterator , typename TSize , typename TOutputIterator > | |
etl::enable_if < etl::is_random_iterator < TInputIterator >::value, TOutputIterator >::type | copy_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin) |
copy_n (Random input iterators)a href="http://en.cppreference.com/w/cpp/algorithm/copy_n"> | |
template<typename TInputIterator , typename TSize , typename TOutputIterator > | |
TOutputIterator | copy_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TOutputIterator o_end) |
copy_n A form of copy_n where the smallest of the two ranges is used. | |
template<typename TInputIterator , typename TSize1 , typename TOutputIterator , typename TSize2 > | |
TOutputIterator | copy_n (TInputIterator i_begin, TSize1 n1, TOutputIterator o_begin, TSize2 n2) |
copy_n A form of copy_n where the smallest of the two ranges is used. | |
template<typename TIterator , typename TOutputIterator , typename TUnaryPredicate > | |
TOutputIterator | copy_if (TIterator begin, TIterator end, TOutputIterator out, TUnaryPredicate predicate) |
copy_ifa href="http://en.cppreference.com/w/cpp/algorithm/copy"> | |
template<typename TInputIterator , typename TOutputIterator , typename TUnaryPredicate > | |
TOutputIterator | copy_if (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end, TUnaryPredicate predicate) |
copy_if A form of copy_if where it terminates when the first end iterator is reached. | |
template<typename TInputIterator , typename TSize , typename TOutputIterator , typename TUnaryPredicate > | |
TOutputIterator | copy_n_if (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryPredicate predicate) |
copy_n_if Combination of copy_n and copy_if. | |
template<typename TIterator , typename TValue > | |
TIterator | binary_find (TIterator begin, TIterator end, const TValue &value) |
binary_findDoes a binary search and returns an iterator to the value or end if not found. | |
template<typename TIterator , typename TValue , typename TBinaryPredicate , typename TBinaryEquality > | |
TIterator | binary_find (TIterator begin, TIterator end, const TValue &value, TBinaryPredicate predicate, TBinaryEquality equality) |
binary_findDoes a binary search and returns an iterator to the value or end if not found. | |
template<typename TIterator , typename TUnaryPredicate > | |
TIterator | find_if_not (TIterator begin, TIterator end, TUnaryPredicate predicate) |
find_if_nota href="http://en.cppreference.com/w/cpp/algorithm/find"> | |
template<typename TIterator , typename TUnaryPredicate > | |
bool | all_of (TIterator begin, TIterator end, TUnaryPredicate predicate) |
all_ofa href="http://en.cppreference.com/w/cpp/algorithm/all_any_none_of"> | |
template<typename TIterator , typename TUnaryPredicate > | |
bool | any_of (TIterator begin, TIterator end, TUnaryPredicate predicate) |
any_ofa href="http://en.cppreference.com/w/cpp/algorithm/all_any_none_of"> | |
template<typename TIterator , typename TUnaryPredicate > | |
bool | none_of (TIterator begin, TIterator end, TUnaryPredicate predicate) |
none_ofa href="http://en.cppreference.com/w/cpp/algorithm/all_any_none_of"> | |
template<typename TIterator1 , typename TIterator2 > | |
bool | is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2) |
is_permutationa href="http://en.cppreference.com/w/cpp/algorithm/is_permutation"> | |
template<typename TIterator1 , typename TIterator2 > | |
bool | is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TIterator2 end2) |
is_permutationa href="http://en.cppreference.com/w/cpp/algorithm/is_permutation"> | |
template<typename TIterator1 , typename TIterator2 , typename TBinaryPredicate > | |
bool | is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TBinaryPredicate predicate) |
is_permutationa href="http://en.cppreference.com/w/cpp/algorithm/is_permutation"> | |
template<typename TIterator1 , typename TIterator2 , typename TBinaryPredicate > | |
bool | is_permutation (TIterator1 begin1, TIterator1 end1, TIterator2 begin2, TIterator2 end2, TBinaryPredicate predicate) |
is_permutationa href="http://en.cppreference.com/w/cpp/algorithm/is_permutation"> | |
template<typename TIterator , typename TUnaryPredicate > | |
bool | is_partitioned (TIterator begin, TIterator end, TUnaryPredicate predicate) |
is_partitioneda href="http://en.cppreference.com/w/cpp/algorithm/is_partitioned"> | |
template<typename TIterator , typename TUnaryPredicate > | |
TIterator | partition_point (TIterator begin, TIterator end, TUnaryPredicate predicate) |
partition_point a href="http://en.cppreference.com/w/cpp/algorithm/partition_point"> | |
template<typename TSource , typename TDestinationTrue , typename TDestinationFalse , typename TUnaryPredicate > | |
std::pair< TDestinationTrue, TDestinationFalse > | 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. | |
template<typename TIterator , typename TUnaryFunction , typename TUnaryPredicate > | |
TUnaryFunction | for_each_if (TIterator begin, const TIterator end, TUnaryFunction function, TUnaryPredicate predicate) |
Like std::for_each but applies a predicate before calling the function. | |
template<typename TIterator , typename TSize , typename TUnaryFunction > | |
TIterator | for_each_n (TIterator begin, TSize n, TUnaryFunction function) |
Like std::for_each but for 'n' iterations. | |
template<typename TIterator , typename TSize , typename TUnaryFunction , typename TUnaryPredicate > | |
TIterator | 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. | |
template<typename TInputIterator , typename TOutputIterator , typename TUnaryFunction > | |
void | transform (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end, TUnaryFunction function) |
A form of std::transform where the transform returns when the first range end is reached. | |
template<typename TInputIterator , typename TSize , typename TOutputIterator , typename TUnaryFunction > | |
etl::enable_if < etl::is_random_iterator < TInputIterator >::value, void >::type | transform_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryFunction function) |
Transform 'n' items. | |
template<typename TInputIterator1 , typename TInputIterator2 , typename TSize , typename TOutputIterator , typename TBinaryFunction > | |
etl::enable_if < etl::is_random_iterator < TInputIterator1 >::value &&etl::is_random_iterator < TInputIterator2 >::value, void >::type | transform_n (TInputIterator1 i_begin1, TInputIterator2 i_begin2, TSize n, TOutputIterator o_begin, TBinaryFunction function) |
Transform 'n' items from two ranges. | |
template<typename TInputIterator , typename TOutputIterator , typename TUnaryFunction , typename TUnaryPredicate > | |
TOutputIterator | 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. | |
template<typename TInputIterator1 , typename TInputIterator2 , typename TOutputIterator , typename TBinaryFunction , typename TBinaryPredicate > | |
TOutputIterator | 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. | |
template<typename TInputIterator , typename TSize , typename TOutputIterator , typename TUnaryFunction , typename TUnaryPredicate > | |
TOutputIterator | transform_n_if (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TUnaryFunction function, TUnaryPredicate predicate) |
Like std::transform_if, for 'n' items. | |
template<typename TInputIterator1 , typename TInputIterator2 , typename TSize , typename TOutputIterator , typename TBinaryFunction , typename TBinaryPredicate > | |
TOutputIterator | 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. | |
template<typename TSource , typename TDestinationTrue , typename TDestinationFalse , typename TUnaryFunctionTrue , typename TUnaryFunctionFalse , typename TUnaryPredicate > | |
std::pair< TDestinationTrue, TDestinationFalse > | 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. | |
template<typename TSource1 , typename TSource2 , typename TDestinationTrue , typename TDestinationFalse , typename TBinaryFunctionTrue , typename TBinaryFunctionFalse , typename TBinaryPredicate > | |
std::pair< TDestinationTrue, TDestinationFalse > | 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. |
Detailed Description
Definition in file algorithm.h.
Generated on Tue Jul 12 2022 14:05:46 by
