cppannotations/yo/stl/logical.yo
2009-06-16 18:08:00 +00:00

19 lines
1 KiB
Text

The i(logical operators) hi(logical operators) are called by the
hi(logical function object) logical function objects. The standard logical
operators are supported: tt(and, or,) and tt(not). The following objects are
available:
itemization(
iti(logical_and<>()): this object's tt(operator()()) member calls
ti(operator&&()) as a binary operator, passing it its two parameters and
returning tt(operator&&())'s return value.
iti(logical_or<>()): this object's tt(operator()()) member calls
ti(operator||()) as a binary operator, passing it its two parameters and
returning tt(operator||())'s return value.
iti(logical_not<>()): this object's tt(operator()()) member calls
tt(operator!()) as a unary operator, passing it its parameter and
returning the unary tt(operator!())'s return value.
)
An example using tt(operator!()) is provided in the following trivial
program, in which the ti(transform()) generic algorithm is used to transform
the logicalvalues stored in an array:
verbinclude(stl/examples/not.cc)