std:: negate<void>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
ヘッダーで定義
<functional>
|
||
|
template
<>
class negate < void > ; |
(C++14以降) | |
std:: negate <> は、パラメータと戻り値の型が推論された std::negate の特殊化です。
目次 |
メンバー型
| 型 | 定義 |
is_transparent
|
unspecified |
メンバー関数
|
operator()
|
その引数の否定を返す
(公開メンバ関数) |
std::negate<void>:: operator()
|
template
<
class
T
>
constexpr
auto
operator
(
)
(
T
&&
arg
)
const
|
||
arg の否定結果を返します。
パラメータ
| arg | - | 否定する値 |
戻り値
- std:: forward < T > ( arg ) 。
例
#include <complex> #include <functional> #include <iostream> int main() { auto complex_negate = std::negate<void>{}; // "void"は省略可能 constexpr std::complex z(4, 2); std::cout << z << '\n'; std::cout << -z << '\n'; std::cout << complex_negate(z) << '\n'; }
出力:
(4,2) (-4,-2) (-4,-2)