< cpp‎ | numeric‎ | complex
complex<T>& operator=( const T& x );
template< class X >
complex<T>& operator=( const complex<X>& cx );

Assigns new values to the contents.

1) Assigns x to the real part of the complex number. Imaginary part is set to zero.
2) Assigns cx.real() and cx.imag() to the real and the imaginary parts of the complex number respectively.


x - value to assign
cx - complex value to assign

Return value


See also

constructs a complex number
(public member function)
A std::complex literal representing pure imaginary number