aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/basic.h
blob: a299938f67d4ef24549f5c3e19dbd8fb2ffb732b (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
29
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_
#define TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_

#include "higher/fold.h"
#include "operation/math.h"

namespace tav {

namespace detail {

template <typename List>
class Length {
	private:
		template <typename, typename Accumulated>
		using accumulate = Add<Size<1>, Accumulated>;

	public:
		typedef tav::Fold<accumulate, Size<0>, List> type;

};

}

template <typename List>
using Length = Eval<detail::Length<List>>;

}

#endif  // TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_