T real() const;
void real (T val);
T
123456789101112
// complex::real example #include <iostream> // std::cout #include <complex> // std::complex int main () { std::complex<double> mycomplex (10.0,1.0); std::cout << "Real part: " << mycomplex.real() << '\n'; return 0; }
Real part: 10