complex::operator=

complex& operator=(const complex& rhs);
complex& operator=(const T& rhs);

The first member function replaces the stored real part with rhs.real() and the stored imaginary part with rhs.imag(). It then returns *this.

The second member function replaces the stored real part with rhs and the stored imaginary part with zero. It then returns *this.

In this implementation, if a translator does not support member template functions, the template:

template<class U>
    complex& operator=(const complex<U>& rhs);

is replaced by:

complex& operator=(const complex& rhs);

which is the default assignment operator.