https://issues.dlang.org/show_bug.cgi?id=20112

Walter Bright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Walter Bright <[email protected]> ---
It is indeed a reinterpret cast, although
https://issues.dlang.org/show_bug.cgi?id=21469 would cause that not to work
sometimes.

It is this way because of consistency with how casting of static arrays works:

  import core.stdc.stdio;

  void main() {
    byte[16] b = 3;
    int[4] ia = cast(int[4]) b;
    foreach (i; ia)
        printf("%x\n", i);
  }

which prints:

  3030303
  3030303
  3030303
  3030303

It is working as designed. At this point, I don't think this can be changed
even if we wanted to.

--

Reply via email to