static array casting

Hoenir mrmocool at gmx.de
Thu Mar 27 12:26:47 PDT 2008


Why does

RGBA[] PALETTE = cast(RGBA[]) [
     0x00, 0x00, 0x00, 0x00, 0xE3, 0x53, 0x00, 0x00,...... ];

work, but

RGBA[256] PALETTE = cast(RGBA[256]) [
     0x00, 0x00, 0x00, 0x00, 0xE3, 0x53, 0x00, 0x00,...];

doesn't?
RGBA simply is a struct containing r,g,b and a as ubytes.


More information about the Digitalmars-d-learn mailing list