std::complex::operator+=,-=,*=,/=
来自cppreference.com
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 | - | 匹配类型( float 、 double 、 long double )的复数或标量值 |
[编辑] 返回值
*this
[编辑] 参阅
对复数运用一元运算符 (函数模板) | |
在两个复数或一个复数和一个标量上运用复数算术运算 (函数模板) |