cppannotations/annotations/yo/stl/logical.yo

19 lines
942 B
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. The
function call operator (tt(operator())) of these function objects calls the
matching logical operator for the objects that are passed to the function
call operator, returning that logical operator's return value. The
logical operator that is actually called is mentioned below:
itemization(
itht(logical_and)(logical_and<>): calls ti(operator&&);
itht(logical_or)(logical_or<>): calls ti(operator||);
itht(logical_not)(logical_not<>): calls tt(operator!).
)
An example using tt(operator!) is provided in the following trivial
program, using ti(transform) to transform
the logicalvalues stored in an array:
verbinclude(-a examples/not.cc)