passing predicates to lowerBound, or alternatively, how lazy is map?

Andrew Brown via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 11 04:50:35 PDT 2014


>
> map is fully lazy.
>
> However, if you've already got the sorted indices in `order`, I 
> would do this:
>
> auto numLessThanN = numbers.indexed(order).countUntil!((x) => x
> >= N)();

That indexed command is perfect though, does the trick, thank you 
very much.


More information about the Digitalmars-d-learn mailing list