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