VLERange: a range in between BidirectionalRange and RandomAccessRange

Lutger Blijdestijn lutger.blijdestijn at gmail.com
Sat Jan 15 04:49:04 PST 2011


Michel Fortin wrote:

> On 2011-01-15 05:03:20 -0500, Lutger Blijdestijn
> <lutger.blijdestijn at gmail.com> said:
...
>> 
>> Is it still possible to solve this problem or are we stuck with
>> specialized string algorithms? Would it work if VleRange of string was a
>> bidirectional range with string slices of graphemes as the ElementType
>> and indexing with code units? Often used string algorithms could be
>> specialized for performance, but if not, generic algorithms would still
>> work.
> 
> I have my idea.
> 
> I think it'd be a good idea is to improve upon Andrei's first idea --
> which was to treat char[], wchar[], and dchar[] all as ranges of dchar
> elements -- by changing the element type to be the same as the string.
> For instance, iterating on a char[] would give you slices of char[],
> each having one grapheme.
> 
...

Yes, this is exactly what I meant, but you are much clearer. I hope this can 
be made to work!



More information about the Digitalmars-d mailing list