[Issue 12736] @nogc std.algorithm.all

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 9 12:15:54 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=12736

Seb <greensunny12 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12 at gmail.com

--- Comment #4 from Seb <greensunny12 at gmail.com> ---
the problem here is auto-decoding and that it can throw an exception,
The following works as expected:

---
void main() @nogc {
    import std.ascii: isDigit;
    import std.algorithm: all;
    import std.utf : byCodeUnit;
    auto b = "12".byCodeUnit.all!isDigit;
}
---

It has long being proposed to disable auto-decoding by introducing an RCString.
I'm not sure whether this should be kept open, because the issue is not on
`all`'s side - all it does is calling `popFront` of string - which happens to
be @nogc (due to throwing UTF Exceptions).

--


More information about the Digitalmars-d-bugs mailing list