diff options
Diffstat (limited to 'src/list/detail/fold_variadic.h')
-rw-r--r-- | src/list/detail/fold_variadic.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/list/detail/fold_variadic.h b/src/list/detail/fold_variadic.h new file mode 100644 index 0000000..e02b604 --- /dev/null +++ b/src/list/detail/fold_variadic.h @@ -0,0 +1,34 @@ +#ifndef TYPEASVALUE_SRC_LIST_DETAIL_FOLD_VARIADIC_H_ +#define TYPEASVALUE_SRC_LIST_DETAIL_FOLD_VARIADIC_H_ + +#include "type.h" + +namespace tav { + +namespace detail { + +template < + template <typename, typename> class Function, + typename Head, + typename... Tail +> +struct fold_variadic { + typedef Function< + Head, + Eval<fold_variadic<Function, Tail...>> + > type; +}; + +template < + template <typename, typename> class Function, + typename Head +> +struct fold_variadic<Function, Head> { + typedef Function<Head, void> type; +}; + +} + +} + +#endif // TYPEASVALUE_SRC_LIST_DETAIL_FOLD_VARIADIC_H_ |