aboutsummaryrefslogtreecommitdiff
path: root/src/list/list.h
blob: 2e335e2bf9155d7c42be3d739f60030e352cd489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef TYPEASVALUE_SRC_LIST_LIST_H_
#define TYPEASVALUE_SRC_LIST_LIST_H_

#include "cons.h"

namespace tav {

template <
	typename    Head,
	typename... Tail
>
struct List {
	typedef typename Cons<
		Head,
		typename List<Tail...>::type
	>::type type;
};

template <typename Head>
struct List<Head> {
	typedef typename Cons<Head, void>::type type;
};

template <
	typename Type,
	Type...  Values
>
using ListOfType = List<
	std::integral_constant<Type, Values>...
>;

template <typename Cons>
using Head = typename Car<Cons>::type;

template <typename Cons>
using Tail = typename Cdr<Cons>::type;

}

#include "operation/basic.h"
#include "operation/nth.h"
#include "operation/take.h"
#include "operation/append.h"
#include "operation/concatenate.h"

#endif  // TYPEASVALUE_SRC_LIST_LIST_H_