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()
2つの引数が等しいかどうかをテストする
(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));
}