std::experimental::ranges::not_equal_to
来自cppreference.com
< cpp | experimental | ranges
| template< class T = void > requires ranges::EqualityComparable<T> || |
(范围 TS) | |
| template <> struct not_equal_to<void>; |
(范围 TS) | |
进行比较的函数对象。初等模板在 T 类型 const 左值上调用 operator == 并对结果取反。特化 not_equal_to<void> 从实参推导函数调用运算符的形参类型(但非返回类型)。
not_equal_to 的所有特化均为 Semiregular 。
成员类型
| 成员类型 | 定义 |
is_transparent (仅为 not_equal_to<void> 特化的成员)
|
/* 未指定 */ |
成员函数
| operator() |
检查参数是否不相等 (公开成员函数) |
std::experimental::ranges::not_equal_to::operator()
| constexpr bool operator()(const T& x, const T& y) const; |
(1) | (仅为初等 not_equal_to<T> 模板的成员) |
| template< class T, class U > requires ranges::EqualityComparableWith<T, U> || |
(2) | (仅为 not_equal_to<void> 特化的成员) |
1) 比较
x 与 y 。等价于 return !ranges::equal_to<>{}(x, y) ;注意
不同于 std::not_equal_to , ranges::not_equal_to 要求 == 与 != 均合法(通过 EqualityComparable 和 EqualityComparableWith 制约),而它完全用
ranges::equal_to 定义。然而,实现可以自由地直接使用 operator!= ,因为这些概念要求 == 与 != 的结果一致。
示例
| 本节未完成 原因:暂无示例 |
参阅
| 实现 x != y 的函数对象 (类模板) |