unary_negate<AdaptablePredicate>

Categories: functors, adaptors

Component type: type

Description

Unary_negate is a function object adaptor: it is an
Adaptable Predicate that represents the logical negation
of some other Adaptable Predicate. That is: if f is an
object of class unary_negate<AdaptablePredicate>, then
there exists an object pred of class AdaptablePredicate
such that f(x) always returns the same value as !pred(x). [1]
There is rarely any reason to construct a unary_negate
directly; it is almost always easier to use the helper function not1.

Example

Finds the first element in a list that does not lie in the range
from 1 to 10.