aboutsummaryrefslogtreecommitdiff
path: root/src/list/generator/detail/generate_nested_structure.h
blob: 77fa0aa8e8702023566d408ecb6716a5e882750b (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
#ifndef TYPEASVALUE_SRC_LIST_GENERATOR_DETAIL_GENERATE_NESTED_STRUCTURE_H_
#define TYPEASVALUE_SRC_LIST_GENERATOR_DETAIL_GENERATE_NESTED_STRUCTURE_H_

#include "type.h"
#include "operation/math.h"

namespace tav {

namespace detail {

template <
	template <typename, typename> class Structure,
	template <typename>           class Generator,
	typename                            Initial,
	typename                            Count
>
struct generate_nested_structure {
	typedef Structure<
		Initial,
		Eval<generate_nested_structure<
			Structure,
			Generator,
			Generator<Initial>,
			Substract<Count, Size<1>>
		>>
	> type;
};

template <
	template <typename, typename> class Structure,
	template <typename>           class Generator,
	typename                            Initial
>
struct generate_nested_structure<Structure, Generator, Initial, Size<0>> {
	typedef void type;
};

}

}

#endif  // TYPEASVALUE_SRC_LIST_GENERATOR_DETAIL_GENERATE_NESTED_STRUCTURE_H_