aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/basic.h
blob: b4aa35ac4dab03a006404b8378db1c23366cf824 (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 typename Fold<
			accumulate,
			Size<0>,
			Cons
		>::type type;

};

}

#endif  // TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_