[complex.members] (original) (raw)

29 Numerics library [numerics]

29.4 Complex numbers [complex.numbers]

29.4.4 Member functions [complex.members]

constexpr complex(const T& re = T(), const T& im = T());

Postconditions: real() == re && imag() == im is true.

template<class X> constexpr explicit(_see below_) complex(const complex<X>& other);

Effects: Initializes the real part with other.real() and the imaginary part with other.imag().

Remarks: The expression inside explicit evaluates to falseif and only if the floating-point conversion rank of Tis greater than or equal to the floating-point conversion rank of X.

constexpr T real() const;

Returns: The value of the real component.

constexpr void real(T val);

Effects: Assigns val to the real component.

constexpr T imag() const;

Returns: The value of the imaginary component.

constexpr void imag(T val);

Effects: Assigns val to the imaginary component.