Major performance problem with std.array.front()

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sun Mar 9 21:19:50 PDT 2014


On 3/9/2014 6:31 PM, Walter Bright wrote:
> On 3/9/2014 6:08 AM, "Marc Schütz" <schuetzm at gmx.net>" wrote:
>> Also, `byCodeUnit` and `byCodePoint` would probably be better names
>> than `raw`
>> and `decode`, to much the already existing `byGrapheme` in std.uni.
>
> I'd vastly prefer 'byChar', 'byWchar', 'byDchar' for each of string,
> wstring, dstring, and InputRange!char, etc.

'byCodePoint' and 'byDchar' are the same. However, 'byCodeUnit' is 
completely different from anything else:

string  str;
wstring wstr;
dstring dstr;

(str|wchar|dchar).byChar  // Always range of char
(str|wchar|dchar).byWchar // Always range of wchar
(str|wchar|dchar).byDchar // Always range of dchar

str.representation  // Range of ubyte
wstr.representation // Range of ushort
dstr.representation // Range of uint

str.byCodeUnit  // Range of char
wstr.byCodeUnit // Range of wchar
dstr.byCodeUnit // Range of dchar



More information about the Digitalmars-d mailing list