From 46e174935b122c0da4b51532a7f683a512eeaf65 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 15 Feb 2015 14:07:50 +0100 Subject: Moved class-based implementations into `detail` namespace * while class templates enable e.g. hiding implementation details they also require evaluation via `Eval` ** this clutters up the actual logic and is now hidden behind aliae that perform the evaluation --- src/list/operation/nth.h | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/list/operation/nth.h') diff --git a/src/list/operation/nth.h b/src/list/operation/nth.h index 08e60cc..5a604f4 100644 --- a/src/list/operation/nth.h +++ b/src/list/operation/nth.h @@ -5,20 +5,22 @@ namespace tav { +namespace detail { + template < typename Index, - typename Pair + typename List > struct Nth { typedef Eval>, - Tail + Tail >> type; }; -template -struct Nth, Pair> { - typedef Head type; +template +struct Nth, List> { + typedef Head type; }; template @@ -31,14 +33,22 @@ struct Nth, void> { typedef void type; }; +} + +template < + typename Index, + typename List +> +using Nth = Eval>; + template -using First = Eval, List>>; +using First = Nth, List>; template -using Second = Eval, List>>; +using Second = Nth, List>; template -using Third = Eval, List>>; +using Third = Nth, List>; } -- cgit v1.2.3