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.
The only difference is that a string can be detected as a
"isNarrowString".
A RA that contains chars would have limited algorithm
capabilities, and be only used with care, but in such a case, I
think indexOf would be one of those algorithms that should
specifically work.
In any case, it shouldn't be that big of a problem. I started the
thread without realizing that string.indexOf existed ... sorry.