From 8432906bf9be6f16aafdb23aaed34f1247404329 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 23 Jan 2015 20:32:48 +0100 Subject: Implemented `ListTabulate` in terms of `Iota` and `Map` * added `Square` function to math operations header to facilitate a simple test case * added appropriate test case --- src/list/generator/higher/list_tabulate.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/list/generator/higher/list_tabulate.h (limited to 'src/list/generator/higher/list_tabulate.h') diff --git a/src/list/generator/higher/list_tabulate.h b/src/list/generator/higher/list_tabulate.h new file mode 100644 index 0000000..9eee599 --- /dev/null +++ b/src/list/generator/higher/list_tabulate.h @@ -0,0 +1,20 @@ +#ifndef TYPEASVALUE_SRC_LIST_GENERATOR_HIGHER_LIST_TABULATE_H_ +#define TYPEASVALUE_SRC_LIST_GENERATOR_HIGHER_LIST_TABULATE_H_ + +#include "list/generator/iota.h" +#include "list/operation/higher/misc.h" + +namespace tav { + +template < + typename Count, + template class Initializer +> +using ListTabulate = Map< + Initializer, + typename Iota, Size<1>>::type +>; + +} + +#endif // TYPEASVALUE_SRC_LIST_GENERATOR_HIGHER_LIST_TABULATE_H_ -- cgit v1.2.3