Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
logical_and
Function Object
Summary
Binary function object that returns true if both of its arguments are true.
Contents
Synopsis●
Description●
Interface●
Warning●
See Also●
Synopsis
#include <functional>
template <class T>
struct logical_and : public binary_function<T, T, bool>;
Description
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:
vector<bool> vec1;
vector<bool> vec2;
vector<bool> vecResult;
.
.
.