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