Skip to content

Commit 71b4a23

Browse files
committed
Remove list_content helper
1 parent 66615d7 commit 71b4a23

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

typelist.hpp

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#pragma once
22

33
namespace tl {
4-
struct null_t {};
4+
5+
struct null_t {
6+
using head = null_t;
7+
using tail = null_t;
8+
};
59

610
template <class T, class U>
711
struct tl
@@ -10,6 +14,13 @@ struct tl
1014
using tail = U;
1115
};
1216

17+
template <class TList>
18+
using head_t = typename TList::head;
19+
20+
template <class TList>
21+
using tail_t = typename TList::tail;
22+
23+
1324
template <class ... Ts> struct make;
1425

1526
template <class T, class ... REST>
@@ -37,24 +48,4 @@ template <class TList, class T>
3748
using append_t = typename append<TList, T>::type;
3849

3950

40-
template <class TList>
41-
struct list_content;
42-
template <class Head, class Tail>
43-
struct list_content<tl<Head, Tail>> {
44-
using head = Head;
45-
using tail = Tail;
46-
};
47-
template <>
48-
struct list_content<null_t> {
49-
using head = null_t;
50-
using tail = null_t;
51-
};
52-
53-
template <class TList>
54-
using head_t = typename list_content<TList>::head;
55-
56-
template <class TList>
57-
using tail_t = typename list_content<TList>::tail;
58-
59-
6051
} // namespace tl

0 commit comments

Comments
 (0)