aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/basic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list/operation/basic.h')
-rw-r--r--src/list/operation/basic.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/list/operation/basic.h b/src/list/operation/basic.h
index 5f9a3f9..a299938 100644
--- a/src/list/operation/basic.h
+++ b/src/list/operation/basic.h
@@ -6,21 +6,24 @@
namespace tav {
-template <typename Cons>
+namespace detail {
+
+template <typename List>
class Length {
private:
template <typename, typename Accumulated>
using accumulate = Add<Size<1>, Accumulated>;
public:
- typedef Eval<Fold<
- accumulate,
- Size<0>,
- Cons
- >> type;
+ typedef tav::Fold<accumulate, Size<0>, List> type;
};
}
+template <typename List>
+using Length = Eval<detail::Length<List>>;
+
+}
+
#endif // TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_