cppannotations/yo/stl/logical.yo
2010-02-28 16:34:35 +00:00

21 lines
1 KiB
Text

The i(logical operators) are called by the
hi(function object: logical)hi(logical function object) logical function
objects. The standard logical operators are supported: tt(and, or,) and
tt(not).
The STL supports the following set of logical function objects:
itemization(
itht(logical_and)(logical_and<>): this object's tt(operator()) member
calls ti(operator&&), passing the latter operator its two parameter values and
returning the latter operator's return value.
itht(logical_or)(logical_or<>): this object's tt(operator()) member calls
ti(operator||), passing the latter operator its two parameter values and
returning the latter operator's return value.
itht(logical_not)(logical_not<>): this object's tt(operator()) member
calls tt(operator!), passing the latter operator its parameter and returning
the latter operator's return value.
)
An example using tt(operator!) is provided in the following trivial
program, using ti(transform) to transform
the logicalvalues stored in an array:
verbinclude(stl/examples/not.cc)