在线文档教程
C++
应用 | Utilities

std::negate

STD:否定

Defined in header
template< class T > struct negate;(until C++14)
template< class T = void > struct negate;(since C++14)

用于执行否定的函数对象。有效呼叫operator-关于类型的实例T...

专门性

The standard library provides a specialization of std::negate when T is not specified, which leaves the parameter types and return type to be deduced. negate function object implementing -x deducing argument and return types (class template specialization)negatefunction object implementing -x deducing argument and return types (class template specialization)(since C++14)
negate<void>function object implementing -x deducing argument and return types (class template specialization)

成员类型

TypeDefinition
result_type(deprecated in C++17)T
argument_type(deprecated in C++17)T

成员函数

operator()returns the negation of the argument (public member function)

STD::否定::操作员%28%29

T operator()( const T& arg ) const;(until C++14)
constexpr T operator()( const T& arg ) const;(since C++14)

返回arg...

参数

arg-value to compute negation of

返回值

结果-arg...

例外

%280%29

可能的实施

常数T运算符%28%29%28 const T&Arg%29 const{back-Arg;}

*。

© cppreference.com

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

http://en.cppreference.com/w/cpp/实用程序/Functional/Negate