diff options
-rw-r--r-- | src/list/operation/basic.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/list/operation/basic.h b/src/list/operation/basic.h index dbd080e..586cf2f 100644 --- a/src/list/operation/basic.h +++ b/src/list/operation/basic.h @@ -2,7 +2,6 @@ #define TYPEASVALUE_SRC_LIST_OPERATION_BASIC_H_ #include "operation/math.h" -#include "conditional/if.h" namespace tav { @@ -24,14 +23,10 @@ template < typename Cons > struct Nth { - typedef If< - equal_value<Index, Size<0>>::value, - Head<Cons>, - typename Nth< - Substract<Index, Size<1>>, - Tail<Cons> - >::type - > type; + typedef typename Nth< + Substract<Index, Size<1>>, + Tail<Cons> + >::type type; }; template <typename Index> @@ -39,6 +34,11 @@ struct Nth<Index, void> { typedef void type; }; +template <typename Cons> +struct Nth<Size<0>, Cons> { + typedef Head<Cons> type; +}; + template < typename Count, typename Current |