[phobos] phobos commit, revision 1860

David Simcha dsimcha at gmail.com
Sat Oct 2 08:21:07 PDT 2010


  Agreed.  This was kind of a quick fix because changing hasSlicing 
would have had a lot of ripple effects and made several unit tests in 
std.algorithm (for example, splitter) not compile.  I just never got 
around to doing a more proper fix because it raises some pretty ugly 
questions with things like splitter.

On 10/2/2010 2:38 AM, Andrei Alexandrescu wrote:
> I think we need to change this. The fix reveals a larger underlying 
> issue: narrow strings (UTF8 and UTF16) should NOT yield true from 
> hasSlicing.
>
> The reason is that hasSlicing has a specific contract associated with 
> it: algorithms assume that range[a .. b] yields elements of range from 
> the a'th up to and excluding the b'th.
>
> That's not the case for string and wstring. They do implement slicing 
> but with a semantics specific to strings.
>
>
> Correct?
>
> Andrei
>
> On 8/14/10 19:17 PDT, dsource.org wrote:
>> phobos commit, revision 1860
>>
>>
>> user: dsimcha
>>
>> msg:
>> Bug 4345:  std.range.take!string: "Nonsensical finite range with 
>> slicing but no length"
>>
>> http://www.dsource.org/projects/phobos/changeset/1860
>>
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>



More information about the phobos mailing list