https://issues.dlang.org/show_bug.cgi?id=8405
--- Comment #5 from [email protected] --- (In reply to John Colvin from comment #4) > Unless there is an exploitable pattern in the lengths (rectangular being the > easiest case), given a NxM range of ranges, it's still O(N). If you store the row lengths into an array, and you perform a cumulative of this array, you can perform a binary search on it, to access in O(ln n). At run-time it can also spot the common case of rectangular matrix, and use a O(1) code path for that case. > Perhaps what we need is a generalisation of length for Ranges of Ranges (of > Ranges ...), called `dimensions` (or `dims`, or `shape`, or whatever seems > best), This is Issue 13685 (and it's an easy structure to implement). --
