aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/length.h
blob: 1f609d4d87ba8cad8af1eb9ab08dfa3709937833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_LENGTH_H_
#define TYPEASVALUE_SRC_LIST_OPERATION_LENGTH_H_

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

namespace tav {

namespace detail {

template <typename, typename Accumulated>
using length_accumulate = Add<Size<1>, Accumulated>;

}

template <typename List>
using Length = Fold<detail::length_accumulate, Size<0>, List>;

}

#endif  // TYPEASVALUE_SRC_LIST_OPERATION_LENGTH_H_