import std.stdio; import std.range; void main() { auto str = "石室詩士施氏,嗜獅,誓食十獅。"d; auto indStr = str.indexed(recurrence!"n"(0)); //core.exception.RangeError@std.range(6177): Range violation writeln(indStr); } This code prints the string correctly, but it seems that it doesn't stop when the end of the string is reached. 石室詩士施氏,嗜獅,誓食十獅。
Also, a workaround: import std.utf; import std.stdio; import std.range; void main() { auto str = "石室詩士施氏,嗜獅,誓食十獅。"d; auto indStr = str.indexed(iota(str.count)); writeln(indStr); readln(); }
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9998 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB