std::logical_or
From cppreference.com
< cpp | utility | functional
| ヘッダ <functional> で定義 |
||
| template< class T > struct logical_or; |
(C++14まで) | |
| template< class T = void > struct logical_or; |
(C++14以降) | |
論理和 (論理選言) を実行するための関数オブジェクト。実質的に型 T の operator|| を呼び出します。
目次 |
[編集] 特殊化
|
標準ライブラリは、
|
(C++14以降) |
[編集] メンバー型
| 型 | 定義 |
result_type (C++17で非推奨)(C++20で削除) |
bool |
first_argument_type (C++17で非推奨)(C++20で削除) |
T
|
second_argument_type (C++17で非推奨)(C++20で削除) |
T
|
|
これらのメンバー型は、std::binary_function<T, T, bool> を公開継承することによって取得されます。 |
(C++11まで) |
[編集] メンバ関数
| operator() |
2つの引数の論理和を返します。 (public member function) |
std::logical_or::operator()
bool operator()( const T& lhs, const T& rhs ) const; |
(C++14以降constexpr) | |
lhs と rhs の論理和を返します。
パラメータ
| lhs, rhs | - | 論理和を計算する値 |
戻り値
lhs || rhs の結果。
[編集] 例外
実装定義の例外をスローする場合があります。
可能な実装
constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs || rhs; } |