From the D Blog: Driving with D

Iain Buclaw ibuclaw at gdcproject.org
Fri Jun 4 21:47:21 UTC 2021


On Friday, 4 June 2021 at 21:28:00 UTC, Max Samukha wrote:
> On Friday, 4 June 2021 at 15:48:50 UTC, rikki cattermole wrote:
>> Does this form of foreach work?
>>
>> foreach(i; 0 .. 10)
>
> That does work.
>
> This doesn't:
>
> ubyte[] slice;
> foreach (ubyte i; slice) {
> }
>
> Invalid bitcast
>   %17 = bitcast i16 %15 to i32
>
> I guess the cause is the same - slice.length.sizeof == 4, while 
> slice.sizeof == 4, slice.ptr.sizeof == 2, and size_t.sizeof == 
> 2.

You should have better luck using gdc on avr.

https://explore.dgnu.org/z/bos5ee


More information about the Digitalmars-d-announce mailing list