aboutsummaryrefslogtreecommitdiff
path: root/src/operation
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-08 19:10:59 +0100
committerAdrian Kummerlaender2015-02-08 19:10:59 +0100
commitdd504e4fcbf73750097024dce397754dc5883386 (patch)
tree73c0c197c4ef8cd106d7a56092b6b5458e573f97 /src/operation
parent3feb8a168075c4007fc466a0a4353e62e69d9802 (diff)
downloadTypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.tar
TypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.tar.gz
TypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.tar.bz2
TypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.tar.lz
TypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.tar.xz
TypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.tar.zst
TypeAsValue-dd504e4fcbf73750097024dce397754dc5883386.zip
Added `GreaterThan` and `LowerThan` comparators
Diffstat (limited to 'src/operation')
-rw-r--r--src/operation/math.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/operation/math.h b/src/operation/math.h
index 28a6832..d855893 100644
--- a/src/operation/math.h
+++ b/src/operation/math.h
@@ -42,6 +42,9 @@ using Divide = std::integral_constant<
X::value / Y::value
>;
+template <typename Base>
+using Square = Multiply<Base, Base>;
+
template <
typename X,
typename Y
@@ -60,8 +63,17 @@ using Even = EqualValue<
template <typename X>
using Odd = Not<Even<X>>;
-template <typename Base>
-using Square = Multiply<Base, Base>;
+template <
+ typename X,
+ typename Y
+>
+using GreaterThan = Boolean<(X::value > Y::value)>;
+
+template <
+ typename X,
+ typename Y
+>
+using LowerThan = Boolean<(X::value < Y::value)>;
}