名稱空間
變體
操作

std::complex<T>::operator+=,-=,*=,/=

來自 cppreference.com
< cpp‎ | 數值‎ | 複數
 
 
 
 
主模板 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 起)
特化 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 起)
特化 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 起)
特化 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 起)
所有特化
(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

[編輯] 引數

其他 - 匹配型別(floatdoublelong double)的複數或標量值

[編輯] 返回值

*this

[編輯] 參閱

對複數應用一元運算子
(函式模板) [編輯]
對兩個複數值或一個複數和一個標量執行復數算術
(函式模板) [編輯]