Skip to content

mp_units::real

Customization point object: the real part of a complex value

Synopsis

Declared in <mp-units/framework/representation_concepts.h>

inline constexpr /* implementation-defined */ real;

Description

Calls clx.real(), or real(clx) found by ADL, and accepts only a result that is real and has the order of clx. Code written for any complex scalar calls it, whichever form the type provides:

// the complex conjugate, for `std::complex` and for a type with free `real()` and `imag()`
template<typename Complex>
constexpr Complex conjugate(const Complex& value)
{
  return Complex(mp_units::real(value), -mp_units::imag(value));
}

Return Value

the real part of clx

Parameters

NameDescription
clxa complex value

See Also