[Issue 12113] A nothrow std.utf.decode with substitution on bad encoding

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 8 16:12:41 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12113


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #2 from Jonathan M Davis <jmdavisProg at gmx.com> 2014-02-08 16:12:39 PST ---
> Is it possible to generalize this to layz ranges?

I should point out that that code doesn't use any range-based functions at all.
However, if decode and stride are both altered to be nothrow, then any function
which was not inferred as nothrow because of them would then be nothrow
(assuming that template inference was working correctly, which is not entirely
the case right now - it does particularly poorly with Voldemort types). So,
there's a good chance that a lot of range-based string stuff would become
nothrow.

As for your example, that uses pure druntime stuff, as it's a string with
foreach. And that code will need to be updated as well as std.utf.decode and
std.utf.stride. However, theoretically, it will be in the same boat and be able
to become nothrow, which would theoretically make your example nothrow, but I'd
have to go digging through the code in druntime to see what all it does in
order to be sure. I expect that it could be nothrow, but there might be
something unexpected that it's doing that prevents it.

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


More information about the Digitalmars-d-bugs mailing list