Algorithms
Functions
-
constexpr const _Ty & min(const _Ty &a, const _Ty &b)
Returns the smaller of the given values.
-
constexpr const _Ty & min(const _Ty &a, const _Ty &b, _LessComp less_comp)
Returns the smaller of the given values.
-
constexpr const _Ty & max(const _Ty &a, const _Ty &b)
Returns the greater of the given values.
-
constexpr const _Ty & max(const _Ty &a, const _Ty &b, _LessComp less_comp)
Returns the greater of the given values.
-
Swaps two values.
-
bool equal(_Iter1 first1, _Iter1 last1, _Iter2 first2)
Tests the equality of two ranges.
-
bool equal(_Iter1 first1, _Iter1 last1, _Iter2 first2, _EqualComp equal_compare)
Tests the equality of two ranges.
-
Searches for the first occurrence of the sequence of elements in the specified range.
-
Searches for the last occurrence of the sequence of elements in the specified range.
-
constexpr _InputIt find(_InputIt first, _InputIt last, const _Ty &value)
Searches for the first element in the range that is equal to (==) the specified value.
-
constexpr _InputIt find_if(_InputIt first, _InputIt last, _UnaryPredicate p)
Searches for the first element in the range that passes the user-provided unary predicate.
-
constexpr _InputIt find_if_not(_InputIt first, _InputIt last, _UnaryPredicate q)
Searches for the first element in the range that fails the user-provided unary predicate.
-
constexpr bool all_of(_InputIt first, _InputIt last, _UnaryPredicate p)
Checks if the unary predicate returns
true
for all elements in the range. -
constexpr bool any_of(_InputIt first, _InputIt last, _UnaryPredicate p)
Checks if the unary predicate returns
true
for at least one element in the range. -
constexpr bool none_of(_InputIt first, _InputIt last, _UnaryPredicate p)
Checks if the unary predicate returns
false
for all elements in the range. -
constexpr _UnaryFunction for_each(_InputIt first, _InputIt last, _UnaryFunction f)
Applies the given function object to every element in the range, in order.
-
void sort(_RandomIt first, _RandomIt last)
Sorts the elements in the range in non-descending order. The order of equal elements is not guaranteed to be preserved.
-
void sort(_RandomIt first, _RandomIt last, _Compare comp)
Sorts the elements in the range in non-descending order. The order of equal elements is not guaranteed to be preserved.
-
_ForwardIt upper_bound(_ForwardIt first, _ForwardIt last, const _Ty &value)
Finds the first element in the range such that
value < element
istrue
. -
_ForwardIt upper_bound(_ForwardIt first, _ForwardIt last, const _Ty &value, _Compare comp)
Finds the first element in the range such that
comp(value, element)
istrue
. -
_ForwardIt lower_bound(_ForwardIt first, _ForwardIt last, const _Ty &value)
Finds the first element in the range such that
element < value
isfalse
. -
_ForwardIt lower_bound(_ForwardIt first, _ForwardIt last, const _Ty &value, _Compare comp)
Finds the first element in the range such that
comp(element, value)
isfalse
. -
bool binary_search(_ForwardIt first, _ForwardIt last, const _Ty &value)
Checks if an element equivalent to the specified value appears within the range.
-
bool binary_search(_ForwardIt first, _ForwardIt last, const _Ty &value, _Compare comp)
Checks if an element equivalent to the specified value appears within the range.
-
_ForwardIt binary_search_iter(_ForwardIt first, _ForwardIt last, const _Ty &value)
Finds an element equivalent to the specified value in the range.
-
_ForwardIt binary_search_iter(_ForwardIt first, _ForwardIt last, const _Ty &value, _Compare comp)
Finds an element equivalent to the specified value in the range.
-
Pair< _ForwardIt, _ForwardIt > equal_range(_ForwardIt first, _ForwardIt last, const _Ty &value)
Gets a range containing all elements equivalent to the specified value in the range.
-
Gets a range containing all elements equivalent to the specified value in the range.
-
bool includes(_InputIt1 first1, _InputIt1 last1, _InputIt2 first2, _InputIt2 last2)
Checks if the sorted range [
first2
,last2
) is a subsequence of the sorted range [first1
,last1
). (A subsequence need not be contiguous.) -
bool includes(_InputIt1 first1, _InputIt1 last1, _InputIt2 first2, _InputIt2 last2, _Compare comp)
Checks if the sorted range [
first2
,last2
) is a subsequence of the sorted range [first1
,last1
). (A subsequence need not be contiguous.) -
_OutputIt copy(_InputIt first, _InputIt last, _OutputIt d_first)
Copies elements from one range to another range.
-
_OutputIt copy_if(_InputIt first, _InputIt last, _OutputIt d_first, UnaryPredicate pred)
Copies elements that pass user-defined function from one range to another range. The relative order of elements that are copied is preserved.
-
Copies elements that appear in the first sorted range and do not appear in the second sorted range to the destination range. The destination range is also sorted.
-
Copies elements that appear in the first sorted range and do not appear in the second sorted range to the destination range. The destination range is also sorted.
-
Constructs a sorted range consisting of elements that are found in both sorted ranges.
-
Constructs a sorted range consisting of elements that are found in both sorted ranges.
-
Computes symmetric difference of two sorted ranges: elements that are found in either of the ranges, but not in both of them are copied to the destination range. The destination range is also sorted.
-
Computes symmetric difference of two sorted ranges: elements that are found in either of the ranges, but not in both of them are copied to the destination range. The destination range is also sorted.
-
Constructs a sorted union beginning at the destination range consisting of the set of elements present in one or both sorted ranges.
-
Constructs a sorted union beginning at the destination range consisting of the set of elements present in one or both sorted ranges.