[Issue 11254] std.string.strip is not nothrow

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 14 09:46:53 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11254



--- Comment #2 from bearophile_hugs at eml.cc 2013-10-14 09:46:51 PDT ---
(In reply to comment #1)

> strip is a unicode aware function, that can remove unicode whites, so it *must*
> decode. So even if "most of the time", it won't throw, in the generic case, it
> can.

Some possible alternative solutions:
- A strip-like function that works on ubyte[] (the return type of
std.string.representation if you give it a string);
- A compile-time switch for std.string.strip that compiles out the
unicode-aware parts.
- A std.ascii.astrip nothrow function designed to work only on ASCII
strings/char[].

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list