diff options
Diffstat (limited to 'src/list/operation')
-rw-r--r-- | src/list/operation/append.h | 4 | ||||
-rw-r--r-- | src/list/operation/basic.h | 4 | ||||
-rw-r--r-- | src/list/operation/higher/filter.h | 2 | ||||
-rw-r--r-- | src/list/operation/higher/map.h | 10 | ||||
-rw-r--r-- | src/list/operation/higher/partition.h | 10 | ||||
-rw-r--r-- | src/list/operation/higher/take_while.h | 4 | ||||
-rw-r--r-- | src/list/operation/nth.h | 10 | ||||
-rw-r--r-- | src/list/operation/reverse.h | 2 | ||||
-rw-r--r-- | src/list/operation/take.h | 4 |
9 files changed, 23 insertions, 27 deletions
diff --git a/src/list/operation/append.h b/src/list/operation/append.h index 9e1be79..6cf15f0 100644 --- a/src/list/operation/append.h +++ b/src/list/operation/append.h @@ -8,13 +8,13 @@ template < typename Secondary > struct Append { - typedef Cons< + typedef typename Cons< Head<Primary>, typename Append< Tail<Primary>, Secondary >::type - > type; + >::type type; }; template <typename Secondary> diff --git a/src/list/operation/basic.h b/src/list/operation/basic.h index 1f4b043..cbbe22c 100644 --- a/src/list/operation/basic.h +++ b/src/list/operation/basic.h @@ -7,11 +7,11 @@ namespace tav { -template <typename Cons> +template <typename Pair> using Length = Fold< Apply<Add, Size<1>, _1>::pair_type, Size<0>, - Cons + Pair >; } diff --git a/src/list/operation/higher/filter.h b/src/list/operation/higher/filter.h index 3fc08ee..acc1422 100644 --- a/src/list/operation/higher/filter.h +++ b/src/list/operation/higher/filter.h @@ -18,7 +18,7 @@ class Filter { > using predicate_wrapper = If< Predicate<Current>::type::value, - Cons<Current, Previous>, + typename Cons<Current, Previous>::type, Previous >; diff --git a/src/list/operation/higher/map.h b/src/list/operation/higher/map.h index a451b2a..9cb6524 100644 --- a/src/list/operation/higher/map.h +++ b/src/list/operation/higher/map.h @@ -15,12 +15,10 @@ class Map { typename Current, typename Previous > - struct function_wrapper { - typedef Cons< - typename Function<Current>::type, - Previous - > type; - }; + using function_wrapper = Cons< + typename Function<Current>::type, + Previous + >; public: typedef typename Fold<function_wrapper, void, List>::type type; diff --git a/src/list/operation/higher/partition.h b/src/list/operation/higher/partition.h index e42b971..a0ea379 100644 --- a/src/list/operation/higher/partition.h +++ b/src/list/operation/higher/partition.h @@ -9,12 +9,10 @@ template < template<typename> class Predicate, typename List > -struct Partition { - typedef Cons< - typename Filter<Predicate, List>::type, - typename Remove<Predicate, List>::type - > type; -}; +using Partition = Cons< + typename Filter<Predicate, List>::type, + typename Remove<Predicate, List>::type +>; } diff --git a/src/list/operation/higher/take_while.h b/src/list/operation/higher/take_while.h index 27f58ed..d04dc2d 100644 --- a/src/list/operation/higher/take_while.h +++ b/src/list/operation/higher/take_while.h @@ -12,10 +12,10 @@ template < struct TakeWhile { typedef typename If< Predicate<Head<Current>>::type::value, - Cons< + typename Cons< Head<Current>, typename TakeWhile<Predicate, Tail<Current>>::type - >, + >::type, void >::type type; }; diff --git a/src/list/operation/nth.h b/src/list/operation/nth.h index 8eb88ba..6020dcb 100644 --- a/src/list/operation/nth.h +++ b/src/list/operation/nth.h @@ -7,18 +7,18 @@ namespace tav { template < typename Index, - typename Cons + typename Pair > struct Nth { typedef typename Nth< Substract<Index, Size<1>>, - Tail<Cons> + Tail<Pair> >::type type; }; -template <typename Cons> -struct Nth<Size<0>, Cons> { - typedef Head<Cons> type; +template <typename Pair> +struct Nth<Size<0>, Pair> { + typedef Head<Pair> type; }; template <typename Index> diff --git a/src/list/operation/reverse.h b/src/list/operation/reverse.h index 632fa5b..83691f8 100644 --- a/src/list/operation/reverse.h +++ b/src/list/operation/reverse.h @@ -16,7 +16,7 @@ class Reverse { struct reversed_append { typedef typename Append< Previous, - Cons<Current, void> + typename Cons<Current, void>::type >::type type; }; diff --git a/src/list/operation/take.h b/src/list/operation/take.h index db25640..c396c28 100644 --- a/src/list/operation/take.h +++ b/src/list/operation/take.h @@ -10,13 +10,13 @@ template < typename Current > struct Take { - typedef Cons< + typedef typename Cons< Head<Current>, typename Take< Substract<Count, Size<1>>, Tail<Current> >::type - > type; + >::type type; }; template <typename Current> |