Namespaces
Variants

std:: equal_to<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 equal_to < void > ;
(C++14부터)

std:: equal_to < void > 는 매개변수와 반환 타입이 추론된 std::equal_to 의 특수화입니다.

목차

중첩 타입

중첩 타입 정의
is_transparent unspecified

멤버 함수

operator()
두 인수가 동일한지 비교하여 검사합니다
(public member function)

std::equal_to<void>:: operator()

template < class T, class U >

constexpr auto operator ( ) ( T && lhs, U && rhs ) const

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

lhs rhs 사이의 동등 비교 결과를 반환합니다.

매개변수

lhs, rhs - 비교할 값들

반환 값

std:: forward < T > ( lhs ) == std:: forward < U > ( rhs ) .

예제

#include <functional>
int main()
{
    constexpr int a = 0, b = 8;
    std::equal_to<> equal{};
    static_assert(equal(a, a));
    static_assert(!equal(a, b));
}