aboutsummaryrefslogtreecommitdiff
path: root/src/type.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-22 17:14:15 +0100
committerAdrian Kummerlaender2015-02-22 17:14:15 +0100
commit41b63eff7f76e6574ef238f821dad0212a619c2a (patch)
tree291652f853e32c80183fd1178d470c5499eee1c5 /src/type.h
parent18fe83991563c0072fabaa60ff161e781a5364c2 (diff)
downloadTypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.gz
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.bz2
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.lz
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.xz
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.tar.zst
TypeAsValue-41b63eff7f76e6574ef238f821dad0212a619c2a.zip
Improved `simulate` function of the Turing machine example
* introduced `state::state_accessor` helper function and moved position logic into `updatePosition` * added `IsEqual` comparator and expressed other basic comparators in terms of itself
Diffstat (limited to 'src/type.h')
-rw-r--r--src/type.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/type.h b/src/type.h
index c2ad2d8..2537b70 100644
--- a/src/type.h
+++ b/src/type.h
@@ -24,10 +24,16 @@ template <
typename X,
typename Y
>
-using IsEqualType = Eval<std::is_same<
+using IsEqual = Eval<std::is_same<X, Y>>;
+
+template <
+ typename X,
+ typename Y
+>
+using IsEqualType = IsEqual<
typename X::value_type,
typename Y::value_type
->>;
+>;
template <
typename X,
@@ -36,13 +42,13 @@ template <
using IsEqualValue = Boolean<X::value == Y::value>;
template <typename X>
-using IsTrue = IsEqualValue<X, Boolean<true>>;
+using IsBoolean = IsEqual<typename X::value_type, bool>;
template <typename X>
-using IsBoolean = Eval<std::is_same<typename X::value_type, bool>>;
+using IsTrue = IsEqualValue<X, Boolean<true>>;
template <typename X>
-using IsSize = Eval<std::is_same<typename X::value_type, std::size_t>>;
+using IsSize = IsEqual<typename X::value_type, std::size_t>;
}