Yes, for some odd reason an
BillWoodruff wrote:1. where T : struct, Enum ... fails without 'struct, and 'struct must precede 'Enum
Enum constraint doesn't automatically imply a
As a result, it's possible to use
where TEnum : class, Enum, which will compile but can never be satisfied.
But it's still better than not having the constraint.
BillWoodruff wrote:2. 'default cannot be used directly ... WeekDays.Default throws an error
default literal can be assigned to a variable of any type, or used as the default value of an optional parameter of any type.
It doesn't add a new member to the enum, so
WeekDays.default won't work if the
WeekDays enum doesn't already contain a
If you want to use the default value without assigning to a variable, you can use
"These people looked deep within my soul and assigned me a number based on the order in which I joined."