std::complex<T>:: operator=
From cppreference.net
|
すべての特殊化
|
||
| (1) | ||
|
complex
&
operator
=
(
const
complex
&
cx
)
;
|
(C++20まで) | |
|
constexpr
complex
&
operator
=
(
const
complex
&
cx
)
;
|
(C++20から) | |
| (2) | ||
|
template
<
class
X
>
complex & operator = ( const std:: complex < X > & cx ) ; |
(C++20まで) | |
|
template
<
class
X
>
constexpr complex & operator = ( const std:: complex < X > & cx ) ; |
(C++20から) | |
|
プライマリテンプレート
complex<T>
|
||
| (3) | ||
|
complex
&
operator
=
(
const
T
&
x
)
;
|
(C++20まで) | |
|
constexpr
complex
&
operator
=
(
const
T
&
x
)
;
|
(C++20から) | |
|
標準浮動小数点型の特殊化
complex<F>
(C++23まで)
|
||
| (3) | ||
|
complex
&
operator
=
(
F x
)
;
|
(C++20まで) | |
|
constexpr
complex
&
operator
=
(
F x
)
;
|
(C++20から)
(C++23まで) |
|
内容に新しい値を割り当てます。
1,2)
cx.real()
および
cx.imag()
をそれぞれ複素数の実部と虚部に代入する。
コピー代入演算子
(1)
は、
T
が浮動小数点型の場合
自明(trivial)
である。
(C++23以降)
3)
複素数の実部に
x
を代入します。虚部はゼロに設定されます。
目次 |
パラメータ
| x | - | 代入する値 |
| cx | - | 代入する複素数値 |
戻り値
* this
注記
C++23以降、コピー代入演算子は trivial であることが要求されますが、実装では一般に全てのモードでtrivialになっています。
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 3935 | C++98 | オーバーロード (2) の説明が欠落していた | 追加された |
関連項目
|
複素数を構築する
(public member function) |
|
|
純虚数を表す
std::complex
リテラル
(function) |