sort struct of arrays

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 9 07:58:31 PDT 2014


On Friday, 9 May 2014 at 14:48:50 UTC, anonymous wrote:
> std.range.zip(fooX, fooY).sort!((a, b) => a[0] < b[0]);
>
> I wasn't sure if that's supposed to work. Turns out the
> documentation on zip [1] has this exact use case as an example.
>
> [1] http://dlang.org/phobos/std_range.html#zip

Ha! Awesome! Sorry that I missed that example.


More information about the Digitalmars-d-learn mailing list