Major performance problem with std.array.front()

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Mar 7 11:59:54 PST 2014


On 3/6/14, 7:55 PM, Walter Bright wrote:
> On 3/6/2014 7:22 PM, bearophile wrote:
>> One advantage of your change is that this code will work:
>>
>> auto s = "hello".dup;
>> s.sort();
>
> Yes, I hadn't thought of that.
>
> The auto-decoding front() introduces all kinds of asymmetry in how
> ranges work, and asymmetry is bad as it negatively impacts composability.

There's no asymmetry, and decoding helps composability as I demonstrated.

Andrei



More information about the Digitalmars-d mailing list