std::not_equal_to<void>

来自cppreference.com
< cpp‎ | utility‎ | functional
 
 
 
函数对象
函数调用
(C++17)(C++23)
恒等函数对象
(C++20)
通透运算符包装器
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
not_equal_to<>
(C++14)
(C++14)
(C++14)

旧式绑定器与适配器
(C++17 前*)
(C++17 前*)
(C++17 前*)
(C++17 前*)
(C++17 前*)(C++17 前*)(C++17 前*)(C++17 前*)
(C++20 前*)
(C++20 前*)
(C++17 前*)(C++17 前*)
(C++17 前*)(C++17 前*)

(C++17 前*)
(C++17 前*)(C++17 前*)(C++17 前*)(C++17 前*)
(C++20 前*)
(C++20 前*)
 
在标头 <functional> 定义
template<>
class not_equal_to<void>;
(C++14 起)

std::not_equal_to<void> 是会推导形参类型和返回类型的 std::not_equal_to 特化。

目录

[编辑] 嵌套类型

嵌套类型 定义
is_transparent 未指定

[编辑] 成员函数

operator()
测试两个实参是否不比较相等
(公开成员函数)

std::not_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));

返回 lhsrhs 间不相等比较的结果。

参数

lhs, rhs - 要比较的值

返回值

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

[编辑] 示例

#include <functional>
 
int main()
{
    constexpr int p = 0, q = 8;
    std::not_equal_to<> not_equal{};
    static_assert(!not_equal(p, p));
    static_assert(not_equal(p, q));
}