[phobos] bug in map

Andrei Alexandrescu andrei at erdani.com
Mon Aug 6 12:33:38 PDT 2012


On 8/6/12 3:11 PM, Jacob Carlborg wrote:
>
> On 6 aug 2012, at 20:55, Andrei Alexandrescu wrote:
>
>> Consider:
>>
>> auto s = "some string";
>> static assert(!hasLength(typeof(s));
>> auto m = map!(a =>  a)(s);
>> static assert(!hasLength(typeof(s));
>
>
> Do you mean:
>
> static assert(!hasLength(typeof(m)));
>
> For the second assert?

Yes, apologies. Essentially mapping a function over characters in a 
string should not automagically define a length property.

Andrei



More information about the phobos mailing list