std::negate
From cppreference.com
Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<functional>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td class="t-dcl-nopad">template< class T >
struct negate;
</td>
struct negate;
<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Function object for performing negation. Effectively calls operator- on an instance of type T
.
Contents |
Member types
Type | Definition |
result_type
|
T
|
argument_type
|
T
|
Member functions
operator() |
returns the negation of the argument (public member function) |
std::negate::operator()
T operator()( const T& arg ) const; |
||
Returns the negation of arg
.
Parameters
arg | - | value to compute negation of |
Return value
The result of -arg.
Exceptions
(none)
Possible implementation
T operator()(const T &arg) const { return -arg; } |