Namespaces
Variants
Views
Actions

std::complex::operator=

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 10:22, 23 April 2013 by P12 (Talk | contribs)

Template:ddcl list begin <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
complex<T>& operator=( const T& x );
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
complex<T>& operator=( const complex<T>& cx );
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

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.

Parameters

x - value to assign
cx - complex value to assign

Return value

*this