在线文档教程
C++
数字 | Numerics

std::complex::operators (unary)

复杂::操作员+%28一元%29,操作员-%28一元%29

template< class T > complex operator+( const complex& val (1)
template< class T > complex<T> operator-( const complex<T>& val (2)

实现了复数一元算术运算符的类比。

1%29返回其参数的值。

2%29否定了这个论点

参数

val-the complex number argument

返回值

1%29一份论点的副本,complex<T>(val)

2%29否决了论点,complex<T>(-val.real(), -val.imag())

另见

operator+operator-operator*operator/performs complex number arithmetics on two complex values or a complex and a scalar (function template)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cpPreference.com/w/cpp/数值/复杂/运算符[医]算术2