Is there a way to create at compile time (or with a constant runtime) a set with members of an ordinal type Tcontaining each named value T?
In other words, how can I complement an empty set of a specific type?
type
TEnum =
(
eA = 1,
eB = 5,
eC = 34
);
TSet = set of TEnum;
const
CSet: TSet = ~[]; // with ~ being my fictional set complement operator
It CSetshould then contain only named values eA, eBand eC.
Of course, this is not a practical question, I'm just wondering
EDIT
I was not aware of the behavior of enum types when declaring with explicit, non-sequential values. The listing still contains unnamed members to fill in the blanks. Updated question to apply only to named members
source
share