Standard library header <algorithm>
From cppreference.com
This header is part of the algorithm library.
Includes | |
(C++11) |
std::initializer_list class template |
Classes | |
Defined in namespace
std::ranges | |
Return types (C++20) | |
(C++20) |
provides a way to store an iterator and a function object as a single unit (class template) |
(C++20) |
provides a way to store two iterators as a single unit (class template) |
(C++20) |
provides a way to store two iterators as a single unit (class template) |
(C++20) |
provides a way to store three iterators as a single unit (class template) |
(C++20) |
provides a way to store three iterators as a single unit (class template) |
(C++20) |
provides a way to store two objects or references of the same type as a single unit (class template) |
(C++20) |
provides a way to store an iterator and a boolean flag as a single unit (class template) |
(C++23) |
provides a way to store an iterator and a value as a single unit (class template) |
(C++23) |
provides a way to store an iterator and a value as a single unit (class template) |
Functions | |
Non-modifying sequence operations | |
(C++11)(C++11)(C++11) |
checks if a predicate is true for all, any or none of the elements in a range (function template) |
applies a unary function object to elements from a range (function template) | |
(C++17) |
applies a function object to the first N elements of a sequence (function template) |
returns the number of elements satisfying specific criteria (function template) | |
finds the first position where two ranges differ (function template) | |
(C++11) |
finds the first element satisfying specific criteria (function template) |
finds the last sequence of elements in a certain range (function template) | |
searches for any one of a set of elements (function template) | |
finds the first two adjacent items that are equal (or satisfy a given predicate) (function template) | |
searches for the first occurrence of a range of elements (function template) | |
searches for the first occurrence of a number consecutive copies of an element in a range (function template) | |
Modifying sequence operations | |
(C++11) |
copies a range of elements to a new location (function template) |
(C++11) |
copies a number of elements to a new location (function template) |
copies a range of elements in backwards order (function template) | |
(C++11) |
moves a range of elements to a new location (function template) |
(C++11) |
moves a range of elements to a new location in backwards order (function template) |
copy-assigns the given value to every element in a range (function template) | |
copy-assigns the given value to N elements in a range (function template) | |
applies a function to a range of elements, storing results in a destination range (function template) | |
assigns the results of successive function calls to every element in a range (function template) | |
assigns the results of successive function calls to N elements in a range (function template) | |
removes elements satisfying specific criteria (function template) | |
copies a range of elements omitting those that satisfy specific criteria (function template) | |
replaces all values satisfying specific criteria with another value (function template) | |
copies a range, replacing elements satisfying specific criteria with another value (function template) | |
swaps the values of two objects (function template) | |
swaps two ranges of elements (function template) | |
swaps the elements pointed to by two iterators (function template) | |
reverses the order of elements in a range (function template) | |
creates a copy of a range that is reversed (function template) | |
rotates the order of elements in a range (function template) | |
copies and rotate a range of elements (function template) | |
(C++20) |
shifts elements in a range (function template) |
(until C++17)(C++11) |
randomly re-orders elements in a range (function template) |
(C++17) |
selects N random elements from a sequence (function template) |
removes consecutive duplicate elements in a range (function template) | |
creates a copy of some range of elements that contains no consecutive duplicates (function template) | |
Partitioning operations | |
(C++11) |
determines if the range is partitioned by the given predicate (function template) |
divides a range of elements into two groups (function template) | |
(C++11) |
copies a range dividing the elements into two groups (function template) |
divides elements into two groups while preserving their relative order (function template) | |
(C++11) |
locates the partition point of a partitioned range (function template) |
Sorting operations | |
(C++11) |
checks whether a range is sorted into ascending order (function template) |
(C++11) |
finds the largest sorted subrange (function template) |
sorts a range into ascending order (function template) | |
sorts the first N elements of a range (function template) | |
copies and partially sorts a range of elements (function template) | |
sorts a range of elements while preserving order between equal elements (function template) | |
partially sorts the given range making sure that it is partitioned by the given element (function template) | |
Binary search operations (on sorted ranges) | |
returns an iterator to the first element not less than the given value (function template) | |
returns an iterator to the first element greater than a certain value (function template) | |
determines if an element exists in a partially-ordered range (function template) | |
returns range of elements matching a specific key (function template) | |
Other operations on sorted ranges | |
merges two sorted ranges (function template) | |
merges two ordered ranges in-place (function template) | |
Set operations (on sorted ranges) | |
returns true if one sequence is a subsequence of another (function template) | |
computes the difference between two sets (function template) | |
computes the intersection of two sets (function template) | |
computes the symmetric difference between two sets (function template) | |
computes the union of two sets (function template) | |
Heap operations | |
(C++11) |
checks if the given range is a max heap (function template) |
(C++11) |
finds the largest subrange that is a max heap (function template) |
creates a max heap out of a range of elements (function template) | |
adds an element to a max heap (function template) | |
removes the largest element from a max heap (function template) | |
turns a max heap into a range of elements sorted in ascending order (function template) | |
Minimum/maximum operations | |
returns the greater of the given values (function template) | |
returns the largest element in a range (function template) | |
returns the smaller of the given values (function template) | |
returns the smallest element in a range (function template) | |
(C++11) |
returns the smaller and larger of two elements (function template) |
(C++11) |
returns the smallest and the largest elements in a range (function template) |
(C++17) |
clamps a value between a pair of boundary values (function template) |
Comparison operations | |
determines if two sets of elements are the same (function template) | |
returns true if one range is lexicographically less than another (function template) | |
compares two ranges using three-way comparison (function template) | |
Permutation operations | |
(C++11) |
determines if a sequence is a permutation of another sequence (function template) |
generates the next greater lexicographic permutation of a range of elements (function template) | |
generates the next smaller lexicographic permutation of a range of elements (function template) | |
Function-like entities (C++20) | |
Defined in namespace
std::ranges | |
Non-modifying sequence operations | |
(C++20)(C++20)(C++20) |
checks if a predicate is true for all, any or none of the elements in a range (algorithm function object) |
(C++20) |
applies a unary function object to elements from a range (algorithm function object) |
(C++20) |
applies a function object to the first N elements of a sequence (algorithm function object) |
(C++20)(C++20) |
returns the number of elements satisfying specific criteria (algorithm function object) |
(C++20) |
finds the first position where two ranges differ (algorithm function object) |
(C++20)(C++20)(C++20) |
finds the first element satisfying specific criteria (algorithm function object) |
(C++23)(C++23)(C++23) |
finds the last element satisfying specific criteria (algorithm function object) |
(C++20) |
finds the last sequence of elements in a certain range (algorithm function object) |
(C++20) |
searches for any one of a set of elements (algorithm function object) |
(C++20) |
finds the first two adjacent items that are equal (or satisfy a given predicate) (algorithm function object) |
(C++20) |
searches for the first occurrence of a range of elements (algorithm function object) |
(C++20) |
searches for the first occurrence of a number consecutive copies of an element in a range (algorithm function object) |
(C++23)(C++23) |
checks if the range contains the given element or subrange (algorithm function object) |
(C++23) |
checks whether a range starts with another range (algorithm function object) |
(C++23) |
checks whether a range ends with another range (algorithm function object) |
Fold operations | |
|