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 포인터 전체 순서가 일관되지 않을 수 있음 일관성이 보장됨