diff options
Diffstat (limited to 'src/list')
-rw-r--r-- | src/list/generator/make_list.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/list/generator/make_list.h b/src/list/generator/make_list.h new file mode 100644 index 0000000..3bf65a2 --- /dev/null +++ b/src/list/generator/make_list.h @@ -0,0 +1,30 @@ +#ifndef TYPEASVALUE_SRC_LIST_GENERATOR_MAKE_LIST_H_ +#define TYPEASVALUE_SRC_LIST_GENERATOR_MAKE_LIST_H_ + +#include "list/cons.h" +#include "operation/math.h" + +namespace tav { + +template < + typename Count, + typename Element +> +struct MakeList { + typedef Cons< + Element, + typename MakeList< + Substract<Count, Size<1>>, + Element + >::type + > type; +}; + +template <typename Element> +struct MakeList<Size<1>, Element> { + typedef Cons<Element, void> type; +}; + +} + +#endif // TYPEASVALUE_SRC_LIST_GENERATOR_MAKE_LIST_H_ |