Sorting a zipped range

Tobias Pankrath tobias at pankrath.net
Thu Feb 27 13:24:19 PST 2014


On Thursday, 27 February 2014 at 21:09:45 UTC, Ben Jones wrote:

> My question is:  which features of the D range abstraction 
> allow zip to work the way we expect?  What C++isms were left 
> behind to make this work?

Many items in std.algorithm / std.range make use of static if to 
provide the most capable return types. I.e. if you zip to RA 
ranges than zip will return a random access range, too.

See 
https://github.com/D-Programming-Language/phobos/blob/master/std/range.d#L4988


More information about the Digitalmars-d-learn mailing list