Too bad that enumeration is not a limiter for generic classes. That would have helped a lot for creating generics classes that would understand that functions such as Ord and GetEnumName were applicable to instances of type T.
TEnum = class Value: T; Values: Set of T; function Low:T; function High:T; function Ord:Integer; procedure FromInteger(const Int: Integer); procedure FromString(const s: string); function ToString:String; function ToTypeString: String; ... as well as enumerators for the entire set, or the T enums found in Values, etc.
Too bad that enumeration is not a limiter for generic classes. That would have helped a lot for creating generics classes that would understand that functions such as Ord and GetEnumName were applicable to instances of type T.
ReplyDeleteTEnum = class
Value: T;
Values: Set of T;
function Low:T;
function High:T;
function Ord:Integer;
procedure FromInteger(const Int: Integer);
procedure FromString(const s: string);
function ToString:String;
function ToTypeString: String;
...
as well as enumerators for the entire set, or the T enums found in Values, etc.