aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/take.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list/operation/take.h')
-rw-r--r--src/list/operation/take.h43
1 files changed, 7 insertions, 36 deletions
diff --git a/src/list/operation/take.h b/src/list/operation/take.h
index effba33..f9aa4b0 100644
--- a/src/list/operation/take.h
+++ b/src/list/operation/take.h
@@ -1,48 +1,19 @@
#ifndef TYPEASVALUE_SRC_LIST_OPERATION_TAKE_H_
#define TYPEASVALUE_SRC_LIST_OPERATION_TAKE_H_
-#include "operation/math.h"
+#include "section.h"
namespace tav {
-namespace detail {
-
-template <
- typename Count,
- typename Current
->
-struct Take {
- typedef Cons<
- Head<Current>,
- Eval<Take<
- Substract<Count, Size<1>>,
- Tail<Current>
- >>
- > type;
-};
-
-template <typename Current>
-struct Take<Size<0>, Current> {
- typedef void type;
-};
-
-template <typename Count>
-struct Take<Count, void> {
- typedef void type;
-};
-
-template <>
-struct Take<Size<0>, void> {
- typedef void type;
-};
-
-}
-
template <
typename Count,
- typename Current
+ typename List
>
-using Take = Eval<detail::Take<Count, Current>>;
+using Take = Section<
+ Size<0>,
+ Substract<Count, Size<1>>,
+ List
+>;
}