std::complex::operator+=,-=,*=,/=

来自cppreference.com
< cpp‎ | numeric‎ | complex
complex<T>& operator+=( const T& other );
(1)
template< class X >
complex<T>& operator+=( const complex<X>& other );
(2)
complex<T>& operator-=( const T& other );
(3)
template< class X >
complex<T>& operator-=( const complex<X>& other );
(4)
complex<T>& operator*=( const T& other );
(5)
template< class X >
complex<T>& operator*=( const complex<X>& other );
(6)
complex<T>& operator/=( const T& other );
(7)
template< class X >
complex<T>& operator/=( const complex<X>& other );
(8)

为复数算术和复数/标量混合算术实现复合赋值运算符。标量参数被当做复数,拥有等于参数的实部和设为零的虚部。

1-2)other 加到 *this
3-4)*this 减去 other
5-6)*this 乘上 other
7-8)other*this

[编辑] 参数

other - 匹配类型( floatdoublelong double )的复数或标量值

[编辑] 返回值

*this

[编辑] 参阅

对复数运用一元运算符
(函数模板) [编辑]
在两个复数或一个复数和一个标量上运用复数算术运算
(函数模板) [编辑]