Name

operator- function template — Performs negation or subtraction

Synopsis

template<typename T>
  complex<T> operator-(const complex<T>&);
   
template<typename T>
  complex<T> operator-(const complex<T>&, const complex<T>&);
template<typename T>
  complex<T> operator-(const complex<T>&, const T&);
template<typename T>
  complex<T> operator-(const T&, const complex<T>&);

The unary negation operator returns -z.

The binary subtraction operator returns the difference of its operands. If either operand is of type T, the argument is interpreted as the real part, with an imaginary part of T( ) or 0.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.