- uint8/byte-uint16
- enum
or equivalent. For signed integers the set’s base type is defined to be in the range 0 .. MaxSetElements-1 where MaxSetElements is currently always 2^16.
The reason is that sets are implemented as high performance bit vectors. Attempting to declare a set with a larger type will result in an error:
These operations are supported by sets:
Sets are often used to define a type for the flags of a procedure. This is a cleaner (and type safe) solution than defining integer constants that have to be or’ed together.
Note how the set turns enum values into powers of 2.
If using enums and sets with C, use distinct cint.