[Issue 13936] groupBy must be redone

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 4 23:58:34 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13936

--- Comment #2 from Andrei Alexandrescu <andrei at erdani.com> ---
With regards to the equivalence relation etc. - there's just too much fuss
about it. Define it simple and robust: there's one quick moving range "fast"
and one slow moving range "slow".

Initially "slow" and "fast" are in the same position. Then move "fast" forward
without moving "slow" until !pred(slow.front, fast.front). At that point
fast-forward slow to fast and continue. Only "fast" needs to call popFront.

For now let the caller worry about transitory vs. non transitory ranges or
equivalence vs. non-equivalence predicates.

--


More information about the Digitalmars-d-bugs mailing list