Dealing with Autodecode

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 1 13:43:09 PDT 2016


On 06/01/2016 04:28 PM, Timon Gehr wrote:
> On 01.06.2016 17:30, Andrei Alexandrescu wrote:
>> On 06/01/2016 11:24 AM, Jonathan M Davis via Digitalmars-d wrote:
>>> It seems more like RCString is an optimization for certain types of
>>> programs than what you'd want to use by default.
>>
>> You'll always want to use it. The small string optimization will make it
>> compelling for all applications. -- Andrei
>
>
> - Why is it dependent on the allocation strategy or on the type of the
> data?

Not getting this.

> - It seems to be a pessimization if I'm taking a lot of small slices.

I agree cases can be created in which straight arrays do sometimes 
better. They are rare and far between - for strings, the small string 
optimization is to live by.

> - It is undesirable if I later want to reference-compare those slices.

Arrays will still be usable.


Andrei



More information about the Digitalmars-d mailing list