std::complex<T>::operator=
来自cppreference.com
                    
                                        
                    
                    
                                                            
                    |   初等模板 complex<T>  | 
||
| (1) | ||
|   complex& operator=(const T& x);  | 
(C++20 前) | |
|   constexpr complex& operator=(const T& x);  | 
(C++20 起) | |
|   特化 complex<float>  | 
||
| (1) | ||
|   complex& operator=(float x);  | 
(C++20 前) | |
|   constexpr complex& operator=(float x);  | 
(C++20 起) | |
|   特化 complex<double>  | 
||
| (1) | ||
|   complex& operator=(double x);  | 
(C++20 前) | |
|   constexpr complex& operator=(double x);  | 
(C++20 起) | |
|   特化 complex<long double>  | 
||
| (1) | ||
|   complex& operator=(long double x);  | 
(C++20 前) | |
|   constexpr complex& operator=(long double x);  | 
(C++20 起) | |
|   所有特化  | 
||
| (2) | ||
|   complex& operator=(const complex& cx);  | 
(C++20 前) | |
|   constexpr complex& operator=(const complex& cx);  | 
(C++20 起) | |
| (3) | ||
|   template<class X> complex& operator=(const std::complex<X>& cx);  | 
(C++20 前) | |
|   template<class X> constexpr complex& operator=(const std::complex<X>& cx);  | 
(C++20 起) | |
赋新值给内容。
1) 赋值 
x 给复数的实部。虚部设为零。2,3) 分别把赋值 
cx.real() 和 cx.imag() 给复数的实部和虚部。参数
| x | - | 要赋值的值 | 
| cx | - | 要赋值的复数值 | 
返回值
*this
参阅
|   构造一个复数  (公开成员函数)  | |
|   表示纯虚数的 std::complex 字面量  (函数)  |