September 06, 2018 [Issue 19229] New: formattedWrite destructively iterates over forward ranges | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19229 Issue ID: 19229 Summary: formattedWrite destructively iterates over forward ranges Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: simen.kjaras@gmail.com unittest { import std.conv; import std.algorithm; auto a = [sort([1,2,3])]; assert(text(a) == text(a)); } The above assert triggers. The issue is std.format.formatRange destructively iterates over a[i], leaving an exhausted range behind. std.format.formatRange or its callers need to be made aware of isForwardRange. -- |
Copyright © 1999-2021 by the D Language Foundation