std::negate<void>
Defined in header <functional> | ? | ? |
---|---|---|
template<> class negate<void>; | ? | (since C++14) |
std::negate<>
是std::negate
并推导出参数和返回类型。
成员类型
Member type | Definition |
---|---|
is_transparent | /* unspecified */ |
成员函数
operator() | returns its negated argument (public member function) |
---|
否定<>::操作符%28%29
template< class T > constexpr auto operator()( T&& arg ) const -> decltype(-std::forward<T>(arg)); | ? | ? |
---|
返回否定的结果。arg
%28或任何一元operator-
重载到执行%29。
参数
arg | - | value to negate |
---|
返回值
结果-arg
...
注记
成员类型is_transparent
向调用方指示此函数对象是透明FunctionObject:它接受任意类型的参数,并使用完美的转发,这避免了在异构上下文中使用函数对象或使用rvalue参数时不必要的复制和转换。特别是模板函数,例如std::set::find
和std::set::lower_bound
在它们的Compare
类型。
例
? cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com