Author: | j |
---|---|
Mode: | text |
Date: | Sat, 24 Apr 2010 23:55:35 |
overloadable maxTypeSize; [T, ...] maxTypeSize(static T, ...) = max(TypeSize(T), maxTypeSize(...)); [T] maxTypeSize(static T) = TypeSize(T); record Union[...] { data : Array[UByte, maxTypeSize(...)]; } unionAs(u : U, static T) { returnref Pointer[T](&u.data)^; }