https://issues.dlang.org/show_bug.cgi?id=14519
--- Comment #17 from Vladimir Panteleev <[email protected]> --- Let's see if I understand the situation correctly... let's say we have a chain: str.a.b.c So, str is a UTF-8 string, and a, b and c are range algorithms (they use .front/.popFront and provide .front/.popFront themselves). If a/b/c don't throw anything themselves, the nothrow attribute will be inferred from the .front/.popFront of the range in front of them (the range they consume), right? That means that if str.front can throw, c can't be nothrow. But if str.front is nothrow, then c CAN be nothrow. But what if we do this: str.forceDecode.a.b.c forceDecode doesn't use str.front - it reads the str directly, code unit by code unit, and inserts replacement characters where it sees error. This allows a, b and c to be nothrow. Unless I'm wrong, I think this idea could work for opt-in replacement character substitution. Following the 90/10 law, it should be easy to insert "forceDecode" in the few relevant places as indicated by a profiler. Does this proposal make sense? --
