aboutsummaryrefslogtreecommitdiff
path: root/src/list/list.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-14 10:43:49 +0100
committerAdrian Kummerlaender2015-02-14 10:43:49 +0100
commite24f25ada7e8f48dc35cb235e045a4324bccb4f2 (patch)
tree3b6c409c7d336557163dcb25e4b11fdef82a3a79 /src/list/list.h
parent73680466149c7aad21de558b7acc11dfa05183d2 (diff)
downloadTypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.gz
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.bz2
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.lz
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.xz
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.tar.zst
TypeAsValue-e24f25ada7e8f48dc35cb235e045a4324bccb4f2.zip
Introduced `Eval` function evaluation helper
* replaces `typename *::type` constructs with `Eval` applications * aims to further unify function evaluation
Diffstat (limited to 'src/list/list.h')
-rw-r--r--src/list/list.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/list/list.h b/src/list/list.h
index 658ac31..e369739 100644
--- a/src/list/list.h
+++ b/src/list/list.h
@@ -10,25 +10,25 @@ template <
typename... Tail
>
struct List {
- typedef typename Cons<
+ typedef Eval<Cons<
Head,
- typename List<Tail...>::type
- >::type type;
+ Eval<List<Tail...>>
+ >> type;
};
template <typename Head>
struct List<Head> {
- typedef typename Cons<Head, void>::type type;
+ typedef Eval<Cons<Head, void>> type;
};
template <typename Head>
struct List<Head, void> {
- typedef typename List<Head>::type type;
+ typedef Eval<List<Head>> type;
};
template <typename... Tail>
struct List<void, Tail...> {
- typedef typename List<Tail...>::type type;
+ typedef Eval<List<Tail...>> type;
};
template <>
@@ -45,10 +45,10 @@ using ListOfType = List<
>;
template <typename Cons>
-using Head = typename Car<Cons>::type;
+using Head = Eval<Car<Cons>>;
template <typename Cons>
-using Tail = typename Cdr<Cons>::type;
+using Tail = Eval<Cdr<Cons>>;
}