std:: greater_equal<void>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Определено в заголовке
<functional>
|
||
|
template
<>
class greater_equal < void > ; |
(начиная с C++14) | |
std:: greater_equal < void > является специализацией std::greater_equal с выведенными типами параметров и возвращаемого значения.
Содержание |
Вложенные типы
| Вложенный тип | Определение |
is_transparent
|
unspecified |
Функции-члены
|
operator()
|
проверяет, сравнивается ли
lhs
больше или равно чем
rhs
(public member function) |
std::greater_equal<void>:: operator()
|
template
<
class
T,
class
U
>
constexpr
auto
operator
(
)
(
T
&&
lhs, U
&&
rhs
)
const
|
||
Возвращает результат std:: forward < T > ( lhs ) >= std:: forward < U > ( rhs ) .
Параметры
| lhs, rhs | - | значения для сравнения |
Возвращаемое значение
std:: forward < T > ( lhs ) >= std:: forward < U > ( rhs ) .
Если вызывается встроенный оператор сравнения указателей, результат соответствует определенному реализацией строгому полному порядку указателей .
Исключения
Может выбрасывать определенные реализацией исключения.
Пример
#include <algorithm> #include <functional> #include <initializer_list> constexpr bool strictly_not_negative(int lhs) { return std::greater_equal<>()(lhs, 0); } int main() { constexpr int low = 0, high = 8; std::greater_equal<> greater_equal{}; static_assert(greater_equal(high, low)); static_assert(greater_equal(low, low)); static constexpr auto arr = {-1, 0, 1, 2, 3, 4}; static_assert(!std::all_of(arr.begin(), arr.end(), strictly_not_negative)); static_assert(std::all_of(arr.begin() + 1, arr.end(), strictly_not_negative)); }
Отчеты о дефектах
Следующие отчеты об изменениях в поведении, содержащие описания дефектов, были применены ретроактивно к ранее опубликованным стандартам C++.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 2562 | C++98 | the pointer total order might be inconsistent | guaranteed to be consistent |