std::complex<T>::operator+=,-=,*=,/=
From cppreference.com
| Primary template complex<T> |
||
| (1) | ||
complex& operator+=( const T& other ); |
(C++20まで) | |
| constexpr complex& operator+=( const T& other ); |
(C++20以降) | |
| (2) | ||
complex& operator-=( const T& other ); |
(C++20まで) | |
| constexpr complex& operator-=( const T& other ); |
(C++20以降) | |
| (3) | ||
complex& operator*=( const T& other ); |
(C++20まで) | |
| constexpr complex& operator*=( const T& other ); |
(C++20以降) | |
| (4) | ||
complex& operator/=( const T& other ); |
(C++20まで) | |
| constexpr complex& operator/=( const T& other ); |
(C++20以降) | |
| Specialization complex<float> |
||
| (1) | ||
complex& operator+=( float other ); |
(C++20まで) | |
| constexpr complex& operator+=( float other ); |
(C++20以降) | |
| (2) | ||
complex& operator-=( float other ); |
(C++20まで) | |
| constexpr complex& operator-=( float other ); |
(C++20以降) | |
| (3) | ||
complex& operator*=( float other ); |
(C++20まで) | |
| constexpr complex& operator*=( float other ); |
(C++20以降) | |
| (4) | ||
complex& operator/=( float other ); |
(C++20まで) | |
| constexpr complex& operator/=( float other ); |
(C++20以降) | |
| Specialization complex<double> |
||
| (1) | ||
complex& operator+=( double other ); |
(C++20まで) | |
| constexpr complex& operator+=( double other ); |
(C++20以降) | |
| (2) | ||
complex& operator-=( double other ); |
(C++20まで) | |
| constexpr complex& operator-=( double other ); |
(C++20以降) | |
| (3) | ||
complex& operator*=( double other ); |
(C++20まで) | |
| constexpr complex& operator*=( double other ); |
(C++20以降) | |
| (4) | ||
complex& operator/=( double other ); |
(C++20まで) | |
| constexpr complex& operator/=( double other ); |
(C++20以降) | |
| Specialization complex<long double> |
||
| (1) | ||
complex& operator+=( long double other ); |
(C++20まで) | |
| constexpr complex& operator+=( long double other ); |
(C++20以降) | |
| (2) | ||
complex& operator-=( long double other ); |
(C++20まで) | |
| constexpr complex& operator-=( long double other ); |
(C++20以降) | |
| (3) | ||
complex& operator*=( long double other ); |
(C++20まで) | |
| constexpr complex& operator*=( long double other ); |
(C++20以降) | |
| (4) | ||
complex& operator/=( long double other ); |
(C++20まで) | |
| constexpr complex& operator/=( long double other ); |
(C++20以降) | |
| All specializations |
||
| (5) | ||
template<class X> complex& operator+=( const std::complex<X>& other ); |
(C++20まで) | |
| template<class X> constexpr complex& operator+=( const std::complex<X>& other ); |
(C++20以降) | |
| (6) | ||
template<class X> complex& operator-=( const std::complex<X>& other ); |
(C++20まで) | |
| template<class X> constexpr complex& operator-=( const std::complex<X>& other ); |
(C++20以降) | |
| (7) | ||
template<class X> complex& operator*=( const std::complex<X>& other ); |
(C++20まで) | |
| template<class X> constexpr complex& operator*=( const std::complex<X>& other ); |
(C++20以降) | |
| (8) | ||
template<class X> complex& operator/=( const std::complex<X>& other ); |
(C++20まで) | |
| template<class X> constexpr complex& operator/=( const std::complex<X>& other ); |
(C++20以降) | |
複素数演算および複素数とスカラーの混在演算のための複合代入演算子を実装します。スカラー引数は、実部が引数と等しく虚部がゼロに設定された複素数として扱われます。
1,5)
other を *this に加算します。2,6) *this から
other を減算します。3,7) *this を
other で乗算します。4,8) *this を
other で除算します。[編集] パラメータ
| その他 | - | 対応する型の複素数またはスカラー値(float、double、long double) |
[編集] 戻り値
*this
[編集] 関連項目
| 複素数に単項演算子を適用する (関数テンプレート) | |
| 2つの複素数値、または複素数とスカラ値の複素数演算を実行する (関数テンプレート) |