stdcomplexoperatorunaryoperator-unary(3)
std::complex<T>::operator+(unary),operator-(unary) - std::complex<T>::operator+(unary),operator-(unary)
Synopsis
template <class T>
(until C++ 20)
std::complex<T>
operator+(const std::complex<T> &val);
template <class T>
(since C++ 20)
constexpr std::complex<T>
operator+(const std::complex<T> &val);
(1)
template <class T>
(until C++ 20)
std::complex<T>
operator-(const std::complex<T> &val);
(2)
template <class T>
(since C++ 20)
constexpr std::complex<T>
operator-(const std::complex<T> &val);Implements the analogs of the unary arithmetic operators for complex numbers.
- Returns the value of its argument
- Negates the argument
Parameters
val - the complex number argument
Return value
- a copy of the argument, std::complex<T>(val)
- negated argument, std::complex<T>(-val.real(), -val.imag())
See also
operator+ performs complex number arithmetics on two complex values or a complex and a scalar operator- (function template) operator* operator/