digitalmars.D.learn - joiner random access range?
- bearophile (19/19) Nov 08 2014 Given a 2D array, I'd like to sort its items sequentially:
- bearophile (5/5) Nov 09 2014 This was Issue 8405 opened by Jonathan M Davis two years ago, I
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
Nov 08 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
Nov 09 2014








"bearophile" <bearophileHUGS lycos.com>