std::is_heap
From cppreference.com
| Defined in header <algorithm>
|
||
| template< class RandomIt > bool is_heap( RandomIt first, RandomIt last ); |
(1) | (since C++11) (constexpr since C++20) |
| template< class ExecutionPolicy, class RandomIt > bool is_heap( ExecutionPolicy&& policy, |
(2) | (since C++17) |
| template< class RandomIt, class Compare > bool is_heap( RandomIt first, RandomIt last, Compare comp ); |
(3) | (since C++11) (constexpr since C++20) |
| template< class ExecutionPolicy, class RandomIt, class Compare > bool is_heap( ExecutionPolicy&& policy, |
(4) | (since C++17) |
Checks whether [first, last) is a heap.
1) The heap property to be checked is with respect to operator<(until C++20)std::less{}(since C++20).
3) The heap property to be checked is with respect to comp.
2,4) Same as (1,3), but executed according to policy.
These overloads participate in overload resolution only if all following conditions are satisfied:
|
std::is_execution_policy_v<std::decay_t<ExecutionPolicy>> is true. |
(until C++20) |
|
std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> is true. |
(since C++20) |
Contents |
[edit] Parameters
| first, last | - | the pair of iterators defining the range of elements to be checked |
| policy | - | the execution policy to use |
| comp | - | comparison function object (i.e. an object that satisfies the requirements of Compare) which returns true if the first argument is less than the second. The signature of the comparison function should be equivalent to the following: bool cmp(const Type1& a, const Type2& b); While the signature does not need to have const&, the function must not modify the objects passed to it and must be able to accept all values of type (possibly const) |