std::complex<T> is a class template which most notably supports:
- storage/access of Cartesian components, via
real()andimag() - arithmetic between complex numbers, via its operator overloads
- overloads of mathematical functions, such as
std::sqrt(std::complex) - used-defined literals such as
3.0ifor initializing imaginary numbers - interoperability with C's
_Complextypes
It is a type with value semantics, meaning that copying it and passing std::complex<T> between functions behaves identically to fundamental types like float.