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

logical_or

Library:  General utilities


Does not inherit

Local Index

No Entries

Summary

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

Synopsis

#include <functional>

namespace std {
  template <class T>
  struct logical_or;
}

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:

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

Interface

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