aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list/operation/higher/misc.h')
-rw-r--r--src/list/operation/higher/misc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/list/operation/higher/misc.h b/src/list/operation/higher/misc.h
index 708265a..280c0d5 100644
--- a/src/list/operation/higher/misc.h
+++ b/src/list/operation/higher/misc.h
@@ -2,6 +2,7 @@
#define TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_MISC_H_
#include "fold.h"
+#include "list/operation/concatenate.h"
namespace tav {
@@ -24,6 +25,25 @@ class Map {
};
+template <typename List>
+class Reverse {
+ private:
+ template <
+ typename Current,
+ typename Previous
+ >
+ struct ReversedConcatenate {
+ typedef typename Concatenate<
+ Previous,
+ Cons<Current, void>
+ >::type type;
+ };
+
+ public:
+ typedef typename Fold<ReversedConcatenate, void, List>::type type;
+
+};
+
}
#endif // TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_MISC_H_