stlab.adobe.com Adobe Systems Incorporated

logical_not

functors.gif
type.gif
Category: functors Component type: type

Description

Logical_not<T> is a functors; specifically, it is an AdaptablePredicate, which means it is a function object that tests the truth or falsehood of some condition. If f is an object of class logical_not<T> and x is an object of class T (where T is convertible to bool) then f(x) returns true if and only if x is false.

Example

Transforms a vector of bool into its logical complement.

Vector<bool> V;
...
transform(V.begin(), V.end(), V.begin(), logical_not<bool>());

Definition

Defined in the standard header functional, and in the nonstandard backward-compatibility header function.h.

Template parameters

Parameter Description Default
T The type of logical_not's argument  

Model of

AdaptablePredicate, DefaultConstructible

Type requirements

T must be convertible to bool.

Public base classes

unary_function<T, bool>

Members

Member Where defined Description
argument_type AdaptableUnaryFunction The type of the second argument: T
result_type AdaptableUnaryFunction The type of the result: bool
bool operator()(const T& x) const UnaryFunction Function call operator. The return value is !x.
logical_not() DefaultConstructible The default constructor.

Notes

See also

The functors, logical_or, logical_and.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google