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

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

namespace tav {

namespace detail {

template <
	typename Current,
	typename Previous
>
using reversed_append = tav::Append<Previous, List<Current>>;

}

template <typename Sequence>
using Reverse = Fold<detail::reversed_append, void, Sequence>;

}

#endif  // TYPEASVALUE_SRC_LIST_OPERATION_REVERSE_H_