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.

Reply via email to