Table of Contents
C++ Algorithms library
https://en.cppreference.com/w/cpp/algorithm
The algorithms library defines functions for a variety of purposes (e.g. searching, sorting, counting, manipulating) that operate on ranges of elements. Note that a range is defined as
where
refers to the element past the last element to inspect or modify.
C++20 provides cpp/language/constraints | constrained versions of most algorithms in the namespace
. In these algorithms, a range can be specified as either an cpp/iterator/input_or_output_iterator | iterator-cpp/iterator/sentinel_for | sentinel pair or as a single
argument, and projections and pointer-to-member callables are supported. Additionally, the Return_types | return types of most algorithms have been changed to return all potentially useful information computed during the execution of the algorithm.
}}
and
) are allowed to make arbitrary copies of elements from ranges, as long as both
and
are
, where
is the type of elements.
(for parallel version of algorithms).
(for execution policies). }}