std::logical_not
From cppreference.com
< cpp | utility | functional
| ヘッダ <functional> で定義 |
||
| template< class T > struct logical_not; |
(C++14まで) | |
| template< class T = void > struct logical_not; |
(C++14以降) | |
論理NOT(論理否定)を実行する関数オブジェクト。型Tのoperator!を実質的に呼び出します。
目次 |
[編集] 特殊化
|
標準ライブラリは、
|
(C++14以降) |
[編集] メンバー型
| 型 | 定義 |
result_type (C++17で非推奨)(C++20で削除) |
bool |
argument_type (C++17で非推奨)(C++20で削除) |
T
|
|
これらのメンバ型は、 |
(C++11まで) |
[編集] メンバ関数
| operator() |
引数の論理NOTを返します。 (public member function) |
std::logical_not::operator()
bool operator()( const T& arg ) const; |
(C++14以降constexpr) | |
argの論理NOTを返します。
パラメータ
| arg | - | 論理NOTを計算する値 |
戻り値
!argの結果。
[編集] 例外
実装定義の例外をスローする場合があります。
可能な実装
constexpr // since C++14 bool operator()(const T& arg) const { return !arg; } |