Bug 20139 – isInputRange!string is false in betterC

Status
RESOLVED
Resolution
LATER
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-18T16:06:24Z
Last change time
2022-04-28T14:21:34Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus

Comments

Comment #0 by snarwin+bugzilla — 2019-08-18T16:06:24Z
The following assertion fails when compiling with -betterC: import std.range.primitives; static assert(isInputRange!string); The cause is the narrow-string version of std.range.primitives.front [1], which calls std.utf.decode [2] on the start of the string. Because decode throws a UTFException on invalid input, it does not compile with betterC. [1] https://dlang.org/phobos/std_range_primitives.html#.front [2] https://dlang.org/phobos/std_utf.html#decode
Comment #1 by dlang-bot — 2022-04-18T19:28:48Z
@iK4tsu updated dlang/phobos pull request #8434 "Fix Issue 20139 - isInputRange!string is false in betterC" fixing this issue: - fix(range.primitives): isInputRange for strings fails in betterC Fix Issue 20139 Signed-off-by: João Lourenço <[email protected]> https://github.com/dlang/phobos/pull/8434
Comment #2 by razvan.nitu1305 — 2022-04-28T14:21:34Z
As per the discussion in the above PR I will close this as "Resolved Later".