std:: negate
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定義先ヘッダ
<functional>
|
||
|
template
<
class
T
>
struct negate ; |
(C++14まで) | |
|
template
<
class
T
=
void
>
struct negate ; |
(C++14以降) | |
否定を実行するための関数オブジェクト。実質的に型
T
のインスタンスに対して
operator
-
を呼び出します。
目次 |
特殊化
|
標準ライブラリは、
|
(C++14以降) |
メンバー型
| 型 | 定義 |
result_type
(C++17で非推奨)
(C++20で削除)
|
T
|
argument_type
(C++17で非推奨)
(C++20で削除)
|
T
|
|
これらのメンバ型は、公開継承によって std:: unary_function < T, T > から取得されます。 |
(C++11まで) |
メンバー関数
|
operator()
|
引数の否定を返す
(公開メンバ関数) |
std::negate:: operator()
|
T operator
(
)
(
const
T
&
arg
)
const
;
|
(constexpr since C++14) | |
arg の否定を返します。
パラメータ
| arg | - | 否定を計算する値 |
戻り値
- arg の結果。
例外
実装定義の例外をスローする可能性があります。
実装例
constexpr T operator()(const T& arg) const { return -arg; } |