[fpc-pascal] Why isn’t SizeOf() allowed in generic arrays?

Sven Barth pascaldragon at googlemail.com
Thu Mar 29 10:49:56 CEST 2012


Am 29.03.2012 10:39, schrieb J.-c. Chu:
> type TBytesOverlay<T>  = array [0..SizeOf(T) - 1] of Byte

As the following does work:

type
   TBytesOverlayLongint = array[0..SizeOf(LongInt) - 1] of Byte;

Your code should work as well, as e.g. TBytesOverlay<LongInt> should 
result in the above code. So please report this as a bug.

Regards,
Sven



More information about the fpc-pascal mailing list