Request for "indexOf" undeprecation.

Sönke Ludwig sludwig at outerproduct.org
Fri Nov 16 09:05:50 PST 2012


Am 16.11.2012 17:50, schrieb monarch_dodra:
> On Friday, 16 November 2012 at 16:33:47 UTC, Sönke Ludwig wrote:
>>
>> As far as I see allowing divergent behavior for index based access and popFront/front would
>> basically mean that no sensible algorithm could be implemented. What should some generic algorithm
>> do with a RA range that returns double[] but yields byte values when using index access? But I guess
>> Andrei has some more specific ideas here.
> 
> But that's exactly what a narrow string does :D: s.front yields a dchar, but s[0] yields a char.

Yes but narrow string are also not RA ranges ;). Any _general_ range algorithm would fail for a
'string' if it would e.g. try to use the random access for look-ahead or something similar. After
all, ranges are a kind of storage abstraction, but if RA would not offer that abstraction they would
be of questionable value.


More information about the Digitalmars-d mailing list