diff options
Diffstat (limited to 'src/list/operation/higher/drop_while.h')
-rw-r--r-- | src/list/operation/higher/drop_while.h | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/src/list/operation/higher/drop_while.h b/src/list/operation/higher/drop_while.h index 021698f..1207020 100644 --- a/src/list/operation/higher/drop_while.h +++ b/src/list/operation/higher/drop_while.h @@ -1,38 +1,28 @@ #ifndef TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_DROP_WHILE_H_ #define TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_DROP_WHILE_H_ -#include "conditional/if.h" +#include "list_index.h" +#include "list/operation/drop.h" +#include "utility/predicate.h" namespace tav { -namespace detail { - -template < - template<typename> class Predicate, - typename Current -> -struct DropWhile { - typedef If< - Eval<Predicate<Head<Current>>>, - Eval<DropWhile<Predicate, Tail<Current>>>, - Current - > type; -}; - -template < - template<typename> class Predicate -> -struct DropWhile<Predicate, void> { - typedef void type; -}; - -} - template < template<typename> class Predicate, - typename Current + typename List > -using DropWhile = Eval<detail::DropWhile<Predicate, Current>>; +using DropWhile = Drop< + typename utility::predicate_assurance< + utility::predicate_negator<std::is_void>::template function, + Length<List> + >::template assure< + ListIndex< + utility::predicate_negator<Predicate>::template function, + List + > + >, + List +>; } |