Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide


Library:  General utilities

Does not inherit

Local Index

No Entries


A binary function object that returns true if both of its arguments are true


#include <functional>

namespace std {
  template <class T>
  struct logical_and;


logical_and is a binary function object. Its operator() returns true if both x and y are true. You can pass a logical_and object to any algorithm that requires a binary function. For example, the transform() algorithm applies a binary operation to corresponding values in two collections and stores the result of the function. logical_and is used in that algorithm in the following manner:

After this call to transform(), listResult(n) contains a 1 (true) if both list1(n) and list2(n) are true, or a 0 (false) if either list1(n) or list2(n) is false.


See Also

binary_function, Function Objects

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 20.3.4

Previous fileTop of DocumentContentsIndex pageNext file