[Issue 13020] New: std.ascii.isASCII for strings too or @nogc all!isASCII
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jul 2 05:08:33 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13020
Issue ID: 13020
Summary: std.ascii.isASCII for strings too or @nogc all!isASCII
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: bearophile_hugs at eml.cc
In std.ascii there is the function:
pure nothrow @safe bool isASCII(dchar c);
I suggest to add an isASCII overload that works on whole strings too (note that
it's @nogc too):
bool isASCII(in string s) pure nothrow @safe @nogc;
Currently you can write:
s.all!isASCII
But this is not @nogc.
An alternative solution is to make "all!isASCII" @nogc.
--
More information about the Digitalmars-d-bugs
mailing list