Sorting according to a primary and secondary criterion
bearophile
bearophileHUGS at lycos.com
Wed Jul 17 05:42:26 PDT 2013
Joseph Rushton Wakeling:
> idx.sort!("arr1[a] < arr1[b] || (arr1[a] == arr1[b] &&
> arr2[a] < arr2[b])");
>
> I (unsurprisingly) get a load of errors about std.functional
> not having access to arr1 or arr2.
You need a lambda delegate for that. But I forgot about multisort
algorithm... It's probably the right tool.
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list