Bug 10400 – char array std.conv.to of iota range

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-06-18T04:47:00Z
Last change time
2013-06-18T04:55:51Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-06-18T04:47:33Z
import std.stdio, std.range, std.algorithm, std.conv; void main() { iota(65, 70).map!(i => cast(char)i).writeln; iota(65, 70).to!(char[]).writeln; } Output, dmd 2.064.2: ABCDE [65, 66, 67, 68, 69] Expected output: ABCDE ABCDE
Comment #1 by bearophile_hugs — 2013-06-18T04:55:51Z
I presume that this: iota(65, 70).to!(char[]) Is seen as similar to: text(iota(65, 70)) So it produces only one string of the whole array. So this bug report is invalid... sorry.