opCmp with structs
Alex via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Nov 7 10:06:05 PST 2015
Found something useful, here:
http://dlang.org/phobos/std_algorithm_sorting.html#makeIndex
with that I can achieve the following
void main(){
ku[] tt = [ku(2), ku(1)];
//writeln(tt);
auto index3 = new size_t[tt.length];
makeIndex!("a.id < b.id")(tt, index3);
//writeln(index3);
}
so my index3 contains the right permutation of the tt array.
What I still need is the possibility to take the values of the tt
array in the order of the generated index. Can somebody give a
hint how to achieve this?
More information about the Digitalmars-d-learn
mailing list