Major performance problem with std.array.front()

Dmitry Olshansky dmitry.olsh at gmail.com
Sat Mar 8 14:44:39 PST 2014


09-Mar-2014 01:15, Walter Bright пишет:
> On 3/8/2014 12:09 AM, Dmitry Olshansky wrote:
>> Becasue Graphemes do not auto-magically convert to dchar and back?
>> After all
>> they are just small strings.
>
> std.uni.Grapheme is a struct, and that struct contains a string of
> arbitrary length.
>
> I don't know if that is the right design or not, or if a Grapheme should
> instead be an alias for a slice (rather than be a distinct type).

They use small-string optimization with great success, as indeed plenty 
of graphemes are just 1 codepoint. Many others are just a couple.

>
> Graphemes do not appear to have a 1:1 mapping with dchars, and any
> attempt to do so would likely be a giant mistake.
>


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list