Логические операции (Logical operations)

Логические операции (Logical operations)

template ‹class T›

struct logical_and: binary_function‹T, T, bool› {

 bool operator()(const T& x, const T& y) const {return x&& y;}

};

template ‹class T›

struct logical_or: binary_function‹T, T, bool› {

 bool operator()(const T& x, const T& y) const {return x || y;}

};

template ‹class T›

struct logical_not: unary_function‹T, bool› {

 bool operator()(const T& x) const {return!x;}

};