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

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

namespace tav {

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

	public:
		typedef Eval<Fold<
			accumulate,
			Size<0>,
			Cons
		>> type;

};

}

#endif  // TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_