aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/reverse.h
blob: d4b2be9b062b79370767404d43755f7b27d54a09 (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
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_REVERSE_H_
#define TYPEASVALUE_SRC_LIST_OPERATION_REVERSE_H_

#include "append.h"
#include "higher/fold.h"

namespace tav {

template <typename Sequence>
class Reverse {
	private:
		template <
			typename Current,
			typename Previous
		>
		using reversed_append = Append<
			Previous,
			Eval<List<Current>>
		>;

	public:
		typedef Eval<Fold<reversed_append, void, Sequence>> type;

};

}

#endif  // TYPEASVALUE_SRC_LIST_OPERATION_REVERSE_H_