Major performance problem with std.array.front()
Vladimir Panteleev
vladimir at thecybershadow.net
Sun Mar 9 09:13:43 PDT 2014
On Sunday, 9 March 2014 at 16:02:55 UTC, bearophile wrote:
> Vladimir Panteleev:
>
>>> Seriously, Bearophile suggested "ABCD".sort(), and it took
>>> about 6 pages (!) for someone to point out this would be
>>> wrong.
>>
>> Sorting a string has quite limited use in the general case,
>
> It seems I am sorting arrays of mutable ASCII chars often
> enough :-)
What do you use this for?
I can think of sort being useful e.g. to see which characters
appear in a string (and with which frequency), but as the concept
does not apply to all languages, one would need to draw a line
somewhere for which languages they want to support. I think this
should be done explicitly in user code.
More information about the Digitalmars-d
mailing list