Article: Why Const Sucks

Martin Nowak code at dawg.eu
Tue Mar 6 19:06:25 UTC 2018


On Tuesday, 6 March 2018 at 18:17:58 UTC, Jonathan M Davis wrote:
> I'm not actually convinced that killing auto-decoding is really 
> much better.

I don't think the problem is auto-decoding in string range 
adapters, but repeated validation.
https://issues.dlang.org/show_bug.cgi?id=14519#c32
If you know that sth. works on code units just use 
.representation.

There is the related annoyance when the user of a function 
presumably knows to only deal with ASCII strings but algorithms 
fail, e.g. splitter.popBack or binary search. This one is tricky 
because broken unicode support is often rooted in ignoring it's 
existence.


More information about the Digitalmars-d-announce mailing list