[review] new string type

Steven Schveighoffer schveiguy at yahoo.com
Thu Dec 2 13:16:13 PST 2010


On Thu, 02 Dec 2010 05:08:54 -0500, spir <denis.spir at gmail.com> wrote:

> On Wed, 01 Dec 2010 20:13:35 -0600
> Ellery Newcomer <ellery-newcomer at utulsa.edu> wrote:
>
>> One thing that strikes me, though, if you're going to keep opIndex, is
>> that being able to do
>>
>> foreach(size_t codeuniti, dchar c; s){
>>
>> }
>
> This would yield several times the same code point / dchar, or do i  
> misinterpret?

It would only yield the code units that are the start of a code point.

So if the code point that starts at the beginning of the array is 2 code  
units long, you would iterate

0, 2, 3, ...

-Steve


More information about the Digitalmars-d mailing list