std::not_equal_to<void>
來自 cppreference.com
定義於標頭檔案 <functional> |
||
template<> class not_equal_to<void>; |
(C++14 起) | |
std::not_equal_to<void> 是 std::not_equal_to 的特化,其引數和返回型別都是推導的。
目錄 |
[edit] 巢狀型別
巢狀型別 | 定義 |
is_transparent
|
未指定 |
[edit] 成員函式
operator() |
測試兩個引數是否不相等 (公開成員函式) |
std::not_equal_to<void>::operator()
template< class T, class U > constexpr auto operator()( T&& lhs, U&& rhs ) const |
||
返回 lhs 與 rhs 之間不等比較的結果。
引數
lhs, rhs | - | 要比較的值 |
返回值
std::forward<T>(lhs) != std::forward<U>(rhs).
[edit] 示例
執行此程式碼
#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)); }