Namespaces
Variants
Views
Actions

std::logical_not

From cppreference.com
< cpp‎ | utility‎ | functional
Revision as of 20:14, 31 May 2013 by P12bot (Talk | contribs)

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Function objects
Function invocation
(C++17)(C++23)
Identity function object
(C++20)
Transparent operator wrappers
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)

Old binders and adaptors
(until C++17*)
(until C++17*)
(until C++17*)
(until C++17*)  
(until C++17*)
(until C++17*)(until C++17*)(until C++17*)(until C++17*)
(until C++20*)
(until C++20*)
(until C++17*)(until C++17*)
(until C++17*)(until C++17*)

(until C++17*)
(until C++17*)(until C++17*)(until C++17*)(until C++17*)
(until C++20*)
(until C++20*)
 
Defined in header <functional>
template< class T >
struct logical_not;

Function object for performing logical NOT (logical negation). Effectively calls operator! for type T.

Contents

Member types

Type Definition
result_type bool
argument_type T

Member functions

operator()
returns the logical NOT of the argument
(public member function)

std::logical_not::operator()

bool operator()( const T& arg ) const;

Returns the logical NOT of arg.

Parameters

arg - value to compute logical NOT of

Return value

The result of !arg.

Exceptions

(none)

Possible implementation

bool operator()(const T &arg) const 
{
    return !arg;
}