summaryrefslogtreecommitdiff
path: root/src/array_fun.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/array_fun.h')
-rw-r--r--src/array_fun.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/array_fun.h b/src/array_fun.h
index a8990b9d..c6d53475 100644
--- a/src/array_fun.h
+++ b/src/array_fun.h
@@ -155,6 +155,13 @@ struct And
};
template<typename T>
+struct Or
+{
+ typedef T returnType;
+ static inline returnType apply(T lhs, T rhs) { return lhs|rhs; }
+};
+
+template<typename T>
struct Negate
{
typedef T returnType;
@@ -184,6 +191,13 @@ operator&(const L& l, const R& r)
return BinExpr<L, And<typename L::returnType>, R>(l, r);
}
+template<typename L, typename R>
+BinExpr<L, Or<typename L::returnType>, R>
+operator|(const L& l, const R& r)
+{
+ return BinExpr<L, Or<typename L::returnType>, R>(l, r);
+}
+
template<typename A>
UnExpr<Negate<typename A::returnType>, A>
operator~(const A& a)