aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher/take_while.h
AgeCommit message (Collapse)Author
2015-02-18Changed `ListIndex` to return false if no index is foundAdrian Kummerlaender
* analogously to `list-index` and `find` in SRFI-1
2015-02-17Reimplemented `TakeWhile` and `DropWhile` in terms of `ListIndex`Adrian Kummerlaender
* new higher order list operation `ListIndex` returns the index of the first list element satisfying a given predicate function ** this enables finding the split index required for both `TakeWhile` and `DropWhile` ** actual list manipulation is then performed using lower order `Take` or `Drop` ** analogously to `list-index` in SRFI-1 ** added appropriate test case * added higher order predicate utility function `utility::predicate_assurance` ** as its name implies this function enables assuring that a value satisfies a given predicate *** if this is not the case a surrogate value is returned instead ** this is used to return a appropriate size value if the `ListIndex` call fails because no element satisfies its predicate ** `detail::predicate_negator` was moved from `Remove`'s implementation details into the newly introduced `utility` namespace *** as it is required by both `TakeWhile` and `DropWhile` in addition to `Remove` * continuation of 8e49cc6
2015-02-15Moved class-based implementations into `detail` namespaceAdrian Kummerlaender
* 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
2015-02-14Introduced `Eval` function evaluation helperAdrian Kummerlaender
* replaces `typename *::type` constructs with `Eval` applications * aims to further unify function evaluation
2015-02-06Revamped to use `Cons` as a function and `Pair` as its resultAdrian Kummerlaender
* this is analogous to _Scheme_ where a pair (dot-expression) is returned from a call to `cons` * `Head` and `Tail` are kept as direct references to the `CAR` and `CDR` values of a pair to match e.g. the math operators
2015-02-05Defer `If` template resolution analogously to other functionsAdrian Kummerlaender
* all other functions sans `Cons` are resolved when the respective member `*::type` is instantiated * this was changed soely to increase coherence
2015-02-01Added `DropWhile` analogously to `TakeWhile`Adrian Kummerlaender
2015-02-01Added `TakeWhile` higher order list operationAdrian Kummerlaender
* as its name implies this function returns the longest initial prefix of a list that satisfies a given _Predicate_ * added appropriate test case