Zipped sorting

cal callumenator at gmail.com
Mon Sep 24 19:56:07 PDT 2012


On Tuesday, 25 September 2012 at 02:17:53 UTC, bearophile wrote:
> This line of code sorts two arrays in "lock step", according to 
> the items of the first array:
>
> zip(first, second).sort!q{a[0] < b[0]}();

Tangential to your point, but I hadn't seen the q{} syntax used 
before. Are there reasons to favor this over other string 
literals?


More information about the Digitalmars-d-learn mailing list