Next : Allocators, Previous : Comparisons, Top : Table of Contents


Logical operations

logical_and Binary Predicate
logical_or Binary Predicate
logical_not Binary Predicate

template 
struct logical_and : binary_function {
    bool operator()(const T& x, const T& y) const { return x && y; }
};

template 
struct logical_or : binary_function {
    bool operator()(const T& x, const T& y) const { return x || y; }
};

template 
struct logical_not : unary_function {
    bool operator()(const T& x) const { return !x; }
};

 

Top