| (1) | ||
template< class T > std::complex<T> operator+( const std::complex<T>& val ); | (until C++20) | |
template< class T > constexpr std::complex<T> operator+( const std::complex<T>& val ); | (since C++20) | |
| (2) | ||
template< class T > std::complex<T> operator-( const std::complex<T>& val ); | (until C++20) | |
template< class T > constexpr std::complex<T> operator-( const std::complex<T>& val ); | (since C++20) |
Implements the analogs of the unary arithmetic operators for complex numbers.
| val | - | the complex number argument |
std::complex<T>(val)
std::complex<T>(-val.real(), -val.imag())
| performs complex number arithmetic on two complex values or a complex and a scalar (function template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/numeric/complex/operator_arith2