Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
algorithm: Standard Algorithms

The algorithm library contains backports of C++ standard algorithms from newer versions of C++, along with additional useful algorithms with similar iterator-based design philosophies.

The public export header is provided by:

Public export location of the content from arene/base/algorithm.

and the stable bazel target is:

//:algorithm

Standard Library Backports

The following algorithms are backported from newer versions of C++ either because they did not yet exist in C++14, or because improvements were introduced in later versions, such as being marked constexpr. The backport of an algorithm is from the most recent ratified stdlib version.

function description stdlib equivalent
arene::base::all_of Checks if a unary predicate returns true for all elements in a specified range std::all_of
arene::base::any_of Checks if a unary predicate returns true for at least one element in a specified range std::any_of
arene::base::clamp Clamps a given value between lower and upper bounds of the same type std::clamp
arene::base::copy Copies the elements in the specified range to another location std::copy
arene::base::copy_if Only copies the elements for which the predicate returns true std::copy_if
arene::base::equal Determines if two sequences are equal std::equal
arene::base::fill Fills a sequence with a given value by repeated assignment. std::fill
arene::base::find Return the first iterator in the specified range with the value specified, or last if there is no such iterator std::find
arene::base::find_if Return the first iterator in the specified range whose value satisfies the specified predicate, or last if there is no such iterator std::find_if
arene::base::inner_product Computes the inner product of two ranges of elements std::inner_product
arene::base::iota Fills a range with successive increments of the starting value std::iota
arene::base::iter_swap Swaps the values of the elements the given iterators are pointing to. std::iter_swap
arene::base::lexicographical_compare Imparts a lexicographical ordering of two sequences std::lexicographical_compare
arene::base::lexicographical_compare_three_way Determines the three-way (less, equal, greater) lexicographical ordering of two sequences std::lexicographical_compare_three_way
arene::base::move Indicate that an object's resources may be transferred to another object std::move
arene::base::move_backward Moves the elements from a range to another range in reverse order std::move_backward
arene::base::rotate Rotates the order of the elements in the specified range in such a way that the element specified as the middle becomes the new first element std::rotate
arene::base::sort Sorts a range into ascending order. std::sort
arene::base::swap_ranges Exchange the elements in one range with the elements of another std::swap_ranges
arene::base::transform Applies the given function to a range of elements and stores the results in another range std::transform
arene::base::transform_reduce Applies an invocable, then reduces out of order std::transform_reduce