How to foreach over a DList?

Steven Schveighoffer schveiguy at yahoo.com
Tue Apr 1 06:50:34 PDT 2014


On Tue, 01 Apr 2014 09:30:18 -0400, Meta <jared771 at gmail.com> wrote:

> On Tuesday, 1 April 2014 at 12:30:03 UTC, monarch_dodra wrote:
>> I fixed this not too long ago. Long story short, the "~="  
>> implementations were made of fail.
>>
>> Just change those "~=" for "insertBack" and you should be fine.
>
> That aside, why is it necessary to cast 1, 2 and 3 to ubyte when adding  
> them to the DList? Is this a problem with DList or with D?

A limitation with D.

The issue is that IFTI interprets numeric literals as type int. There  
simply is no way to say "if you get a numeric literal that fits within a  
ubyte, use ubyte as the type for T"

See this bug report: http://d.puremagic.com/issues/show_bug.cgi?id=4998

-Steve


More information about the Digitalmars-d-learn mailing list