I wanna make a generic class that can generates all six relational operators with the passed in class T which has only one lessThan operator. But fpc can't recognize blow code:
generic tLess<T>= class
public type
tT= T;
public
class function lessThan(const a, b: T): boolean;
end;
generic tCompOps<C>= class
public type
T= C.tT; //// Error: Error in type definition ////
public
class function equal(const a, b: T): boolean;
class function notEqual(const a, b: T): boolean;
class function lessThan(const a, b: T): boolean;
class function lessThanOrEqual(const a, b: T): boolean;
class function greaterThan(const a, b: T): boolean;
class function greaterThanOrEqual(const a, b: T): boolean;
end;I hope this feature could be implemented if it's possible.
