aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/list/operation/higher/partition.h6
-rw-r--r--src/list/operation/nth.h14
2 files changed, 17 insertions, 3 deletions
diff --git a/src/list/operation/higher/partition.h b/src/list/operation/higher/partition.h
index a0ea379..aed0ea6 100644
--- a/src/list/operation/higher/partition.h
+++ b/src/list/operation/higher/partition.h
@@ -7,11 +7,11 @@ namespace tav {
template <
template<typename> class Predicate,
- typename List
+ typename Elements
>
using Partition = Cons<
- typename Filter<Predicate, List>::type,
- typename Remove<Predicate, List>::type
+ typename Filter<Predicate, Elements>::type,
+ typename Remove<Predicate, Elements>::type
>;
}
diff --git a/src/list/operation/nth.h b/src/list/operation/nth.h
index 6020dcb..076add4 100644
--- a/src/list/operation/nth.h
+++ b/src/list/operation/nth.h
@@ -26,6 +26,20 @@ struct Nth<Index, void> {
typedef void type;
};
+template <>
+struct Nth<Size<0>, void> {
+ typedef void type;
+};
+
+template <typename List>
+using First = typename Nth<Size<0>, List>::type;
+
+template <typename List>
+using Second = typename Nth<Size<1>, List>::type;
+
+template <typename List>
+using Third = typename Nth<Size<2>, List>::type;
+
}
#endif // TYPEASVALUE_SRC_LIST_OPERATION_NTH_H_