[Issue 13041] std.range.transposed consumes sub-ranges

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 2 13:24:31 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=13041

--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
It certainly is possible. Note there is current work to update Transposed to
use transverse to allow indexing https://github.com/dlang/phobos/pull/5805.

I think we can go further building upon transverse, and its related option on
how to treat the data.

But it would be a strange relationship between transposed and its subranges. If
the subranges were indexable, then Transposed can be a forward range, otherwise
it can't. Seems unintuitive, and not sure it's worth all the effort.

In other cases as well (if, for instance, the RangeOfRanges stores everything
by value), then save could also be implemented. We may have a hard time
detecting this because the relationship between Transposed and whether it's
valid to make a copy is confusing and not well-established.

--


More information about the Digitalmars-d-bugs mailing list