std::experimental::ranges::less_equal
來自 cppreference.com
< cpp | experimental | ranges
定義於標頭檔案 <experimental/ranges/functional> |
||
template< class T = void > requires StrictTotallyOrdered<T> || |
(ranges TS) | |
template<> struct less_equal<void>; |
(ranges TS) | |
用於執行比較的函式物件。主模板在型別為 T
的 const 左值上以反轉的引數順序呼叫 operator<,然後對結果取反。特化 less_equal<void>
從引數推導函式呼叫運算子的引數型別(但不是返回型別)。
less_equal
的所有特化都是 Semiregular
。
目錄 |
[編輯] 成員型別
成員型別 | 定義 |
is_transparent (僅為 less_equal<void> 特化的成員) |
/* 未指定 */ |
[編輯] 成員函式
operator() |
檢查第一個引數是否小於或等於第二個引數 (公開成員函式) |
std::experimental::ranges::less_equal::operator()
constexpr bool operator()(const T& x, const T& y) const; |
(1) | (僅為主 less_equal<T> 模板的成員) |
template< class T, class U > requires StrictTotallyOrderedWith<T, U> || |
(2) | (僅為 less_equal<void> 特化的成員) |
[編輯] 注意
與 std::less_equal 不同,ranges::less_equal
要求所有六個比較運算子 <
, <=
, >
, >=
, ==
和 !=
都是有效的(透過 StrictTotallyOrdered
和 StrictTotallyOrderedWith
約束),並且完全是根據 ranges::less 定義的。然而,實現可以自由地直接使用 operator<=,因為這些概念要求比較運算子的結果是一致的。
[編輯] 示例
本節不完整 原因:無示例 |
[編輯] 參閱
實現 x <= y 的函式物件 (類模板) |