std::experimental::ranges::not_equal_to
來自 cppreference.com
< cpp | experimental | ranges
定義於標頭檔案 <experimental/ranges/functional> |
||
template< class T = void > requires EqualityComparable<T> || |
(ranges TS) | |
template<> struct not_equal_to<void>; |
(ranges 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 EqualityComparableWith<T, U> || |
(2) | (僅在 not_equal_to<void> 特化中是成員) |
[編輯] 註解
與 std::not_equal_to 不同,ranges::not_equal_to
要求 ==
和 !=
都是有效的(透過 EqualityComparable
和 EqualityComparableWith
約束),並且完全是根據 ranges::equal_to 定義的。然而,實現可以自由地直接使用 operator!=,因為這些概念要求 ==
和 !=
的結果保持一致。
[編輯] 示例
本節不完整 原因:無示例 |
[編輯] 參閱
實現 x != y 的函式物件 (類模板) |