July 20, 2016
On Wednesday, 20 July 2016 at 16:03:27 UTC, pineapple wrote:
> On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
>> There is no auto-decoding going on here, as char[] and wchar[] are rejected outright since they are not considered random access ranges.
>
> They are considered random access ranges by my ranges library, because they are treated as arrays of characters and not as unicode strings.

I think you mean that your range library treats them as arrays of code units, meaning your library will break (some) unicode strings.

Note that auto decoding and random access range are different. The isRandomAccess check must make a special condition that the string is not "narrow" else they would be considered random access even though front automatically decodes.

922: static assert(!isNarrowString!R);
July 21, 2016
On Wednesday, 20 July 2016 at 16:44:11 UTC, ketmar wrote:
> On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
>> There is no auto-decoding going on here,
> ...
>
>> as char[] and wchar[] are rejected outright since they are not considered random access ranges.
> ...due to autodecoding.

No, due to them being multi-byte formats. I don't see what auto decoding has to do with it. That's a separate concept. We could take auto decoding out of Phobos and still disqualify them as random access ranges.
July 21, 2016
On Wednesday, 20 July 2016 at 18:32:15 UTC, Jesse Phillips wrote:
> I think you mean that your range library treats them as arrays of code units, meaning your library will break (some) unicode strings.

Right - I disagree with the assessment that all (or even most) char[] types are intended to represent unicode strings, rather than arrays containing chars.

If you want your array to be interpreted as a unicode string, then you should use std.utc's byGrapheme or similar functions.
1 2 3
Next ›   Last »