Namespaces
Variants

std:: greater_equal<void>

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
Old binders and adaptors
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
( until C++17* ) ( until C++17* )
( until C++17* ) ( until C++17* )

( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
ヘッダーで定義 <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

- > decltype ( std:: forward < T > ( lhs ) >= std:: forward < U > ( rhs ) ) ;

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 適用対象 公開時の動作 正しい動作
LWG 2562 C++98 ポインタの全順序が一貫しない可能性がある 一貫性が保証される