Bug 17741 – std.range.transposed does not work with Map

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-08-10T23:30:55Z
Last change time
2017-10-26T15:55:43Z
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2017-08-10T23:30:55Z
auto ror = 5.iota.map!(y => 5.iota.map!(x => x * y)); auto result = ror.transposed; Error: template std.range.transposed cannot deduce function from argument types !()(MapResult!(__lambda1, Result)), candidates are:
Comment #1 by razvan.nitu1305 — 2017-10-25T12:19:18Z
What should be the solution here? Implement an overload which accepts a range with non-assignable elements and returns a range with non-assignable elements or offer the illusion of assign-ability by implementing a hashtable on top of transpose which tracks the changes performed in the initial range?
Comment #2 by alexandru.razvan.c — 2017-10-26T13:45:44Z
Created a PR for this. I had to change a test for issue #8764 https://issues.dlang.org/show_bug.cgi?id=8764 However I checked and it's not introducing any regression.
Comment #3 by alexandru.razvan.c — 2017-10-26T13:46:02Z
Comment #4 by alexandru.razvan.c — 2017-10-26T15:55:43Z
Decided to close this issue. The simple workaround is to use: auto result = ror.array.transposed;