How would I sort an associative array by value?

Timon Gehr timon.gehr at gmx.ch
Fri Jun 29 11:00:05 PDT 2012


On 06/29/2012 07:52 PM, ixid wrote:
> Or more generally does D have a library function so I can sort one array
> based on sorting the contents of another?

sort!"a[0]<b[0]"(zip(basedOnThis, alsoSortThis));

This sorts both ranges in-place based on the contents of the first range.


More information about the Digitalmars-d-learn mailing list