20 General utilities library [utilities]

20.8 Function objects [function.objects]

20.8.8 Negators [negators]

Negators not1 and not2 take a unary and a binary predicate, respectively, and return their complements ([expr.unary.op]).

template <class Predicate> class unary_negate { public: explicit unary_negate(const Predicate& pred); bool operator()(const typename Predicate::argument_type& x) const; typedef typename Predicate::argument_type argument_type; typedef bool result_type; };

operator() returns !pred(x).

template <class Predicate> unary_negate<Predicate> not1(const Predicate& pred);

Returns: unary_negate<Predicate>(pred).

template <class Predicate> class binary_negate { public: explicit binary_negate(const Predicate& pred); bool operator()(const typename Predicate::first_argument_type& x, const typename Predicate::second_argument_type& y) const; typedef typename Predicate::first_argument_type first_argument_type; typedef typename Predicate::second_argument_type second_argument_type; typedef bool result_type; };

operator() returns !pred(x,y).

template <class Predicate> binary_negate<Predicate> not2(const Predicate& pred);

Returns: binary_negate<Predicate>(pred).