std::negate<void>
提供: cppreference.com
<tbody>
</tbody>
| ヘッダ <functional> で定義
|
||
template<> class negate<void>; |
(C++14以上) | |
std::negate<> は引数と戻り値の型を推定する std::negate の特殊化です。
メンバ型
| メンバ型 | 定義 |
is_transparent
|
/* unspecified */ |
メンバ関数
| 引数の否定を返します (パブリックメンバ関数) |
std::negate<>::operator()
<tbody> </tbody> template< class T > constexpr auto operator()( T&& arg ) const -> decltype(-std::forward<T>(arg)); |
||
arg の否定の結果 (またはオーバーロードされている場合は単項 operator- の結果) を返します。
引数
| arg | - | 否定する値 |
戻り値
-arg の結果。
ノート
メンバ型 is_transparent はこの関数オブジェクトが透過的な関数オブジェクトである、つまり、任意の型の引数を受理し、不均一な分脈や右辺値引数で使用されたときに不要なコピーや変換を回避する完全転送を使用することを、呼び出し元に示します。 特に、 std::set::find や std::set::lower_bound のようなテンプレート関数は Compare 型についてこのメンバ型を使用します。
例
| This section is incomplete Reason: no example |