std.range should provide a takeWhile(alias pred,R)(R arg) function, that returns its argument cut off at the first position where the predicate is false.
This is particularly useful when dealing with infinite ranges.
Example:
assert(equal(takeWhile!"a<100"(recurrence!"a[n-2]+a[n-1]"(1,1))), [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]));
Comment #1 by timon.gehr — 2011-06-04T13:36:46Z
*** This issue has been marked as a duplicate of issue 4535 ***