Major performance problem with std.array.front()

Vladimir Panteleev vladimir at thecybershadow.net
Fri Mar 7 17:41:00 PST 2014


On Saturday, 8 March 2014 at 01:38:39 UTC, Andrei Alexandrescu 
wrote:
> On 3/7/14, 4:39 PM, Vladimir Panteleev wrote:
>>> s.canFind('é')
>>> s.endsWith('é')
>>> s.find('é')
>>> s.count('é')
>>> s.countUntil('é')
>>
>> These should not compile post-change, because the sought 
>> element (dchar)
>> is not of the same type as the string. So they will not fail 
>> silently.
>
> The compared element need not have the same type (otherwise 
> we'd break some other code).

Do you think such code will appear often in practice? Even if the 
type is a dchar, in some cases the programmer may not have 
intended to do decoding (e.g. the "dchar" type was a result of 
type deduction form .front OSLT).


More information about the Digitalmars-d mailing list