Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
logical_or
Function Object
Summary
Binary function object that returns true if either of its arguments are true.
Contents
Synopsis●
Description●
Interface●
Warning●
See Also●
Synopsis
#include <functional>
template <class T>
struct logical_or : binary_function<T, T, bool> ;
Description
logical_or is a binary function object. Its operator() returns true if either x or y are true. You can pass a
logical_or 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_or is used in that algorithm in the following manner:
vector<bool> vec1;
vector<bool> vec2;
vector<bool> vecResult;
.
.
.
transform(vec1.begin(), vec1.end(),