std::complex<T>::operator+(unary), operator-(unary)

From cppreference.com
< cpp‎ | numeric‎ | complex
 
 
Numerics library
Common mathematical functions
Mathematical special functions (哋它亢++17)
Mathematical constants (哋它亢++20)
Basic linear algebra algorithms (哋它亢++26)
Floating-point environment (哋它亢++11)
Complex numbers
Numeric arrays
Pseudo-random number generation
Factor operations
(哋它亢++17)
(哋它亢++17)
Interpolations
(哋它亢++20)
(哋它亢++20)
Saturation arithmetic
(哋它亢++26)
(哋它亢++26)
(哋它亢++26)
(哋它亢++26)
(哋它亢++26)

Generic numeric operations
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
(哋它亢++17)
Bit operations
(哋它亢++20)    
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++23)
(哋它亢++20)
 
 
(1)
template< class T >
std::complex<T> operator+( const std::complex<T>& val );
(until 哋它亢++20)
template< class T >
constexpr std::complex<T> operator+( const std::complex<T>& val );
(since 哋它亢++20)
(2)
template< class T >
std::complex<T> operator-( const std::complex<T>& val );
(until 哋它亢++20)
template< class T >
constexpr std::complex<T> operator-( const std::complex<T>& val );
(since 哋它亢++20)

Implements the analogs of the unary arithmetic operators for complex numbers.

1) Returns the value of its argument
2) Negates the argument

Parameters

val - the complex number argument

Return value

1) a copy of the argument, std::complex<T>(val)
2) negated argument, std::complex<T>(-val.real(), -val.imag())

See also

performs complex number arithmetic on two complex values or a complex and a scalar
(function template)