std::not2 (3) - Linux Manuals
std::not2: std::not2
NAME
Synopsis
Defined in header <functional>
template< class Predicate > (until C++14)
std::binary_negate<Predicate> not2(const Predicate& pred);
template< class Predicate > (since C++14)
constexpr std::binary_negate<Predicate> not2(const Predicate& pred); (deprecated in C++17)
not2 is a helper function to create a function object that returns the complement of the binary predicate function passed. The function object created is of type std::binary_negate<Predicate>.
The binary predicate type must define two member types, first_argument_type and second_argument_type, that are convertible to the predicate's parameter types. The function objects obtained from std::owner_less, std::ref, std::cref, std::plus, std::minus, std::multiplies, std::divides, std::modulus, std::equal_to, std::not_equal_to, std::greater, std::less, std::greater_equal, std::less_equal, std::logical_not, std::logical_or, std::bit_and, std::bit_or, std::bit_xor, std::mem_fn, std::map::value_comp, std::multimap::value_comp, std::function, or from another call to std::not2 have these types defined, as are function objects derived from the deprecated std::binary_function.
Parameters
pred - binary predicate
Return value
std::not2 returns an object of type std::binary_negate<Predicate>, constructed with pred.
Exceptions
None.
Example
// Run this code