November 09, 2014
Given a 2D array, I'd like to sort its items sequentially:


import std.stdio, std.algorithm, std.range;

void foo(int[][] m) {
    m.joiner.sort().writeln; // error
}
void main() {
    auto m = [[10, 2], [30, 4]];
    m.joiner.writeln;
    foo(m);
    m.joiner.writeln;
    // OK, but the matrix can have arbitrary many rows.
    chain(m[0], m[1]).sort();
    m.joiner.writeln;
}


Is it possible and reasonable for "joiner" to return a random access range in such cases (where the input is a random access range of random access ranges), so I can sort its items?

Bye,
bearophile
November 09, 2014
This was Issue 8405 opened by Jonathan M Davis two years ago, I have added my use cases:
https://issues.dlang.org/show_bug.cgi?id=8405

Bye,
bearophile