Namespaces
Variants

std::ranges:: greater

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>
struct greater ;
(C++20부터)

비교를 수행하기 위한 함수 객체입니다. 함수 호출 연산자의 매개변수 유형을 인수로부터 추론합니다(반환 유형은 제외).

목차

중첩 타입

중첩 타입 정의
is_transparent unspecified

멤버 함수

operator()
첫 번째 인수가 두 번째 인수보다 큰지 확인합니다
(public member function)

std::ranges::greater:: operator()

template < class T, class U >
constexpr bool operator ( ) ( T && t, U && u ) const ;

다음 코드와 동일합니다: return ranges:: less { } ( std:: forward < U > ( u ) , std:: forward < T > ( t ) ) ; .

이 오버로드는 오버로드 해결에 다음 조건이 만족될 때만 참여합니다: std:: totally_ordered_with < T, U > 가 만족되는 경우.

참고 사항

std::greater 와 달리, std::ranges::greater 는 여섯 가지 비교 연산자 < , <= , > , >= , == != 가 모두 유효해야 하며( totally_ordered_with 제약 조건을 통해), std::ranges::less 를 기반으로 완전히 정의됩니다.

예제

결함 보고서

다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.

DR 적용 대상 게시된 동작 올바른 동작
LWG 3530 C++20 포인터 비교 시 구문적 검사가 완화됨 의미론적 요구사항만 완화됨

참고 항목

함수 객체 구현 x > y
(클래스 템플릿)