No, it's not a dilemma, but rather a requirement. Before generics 
specialization, all required operations for given type must be known. This 
is because the symbol table when the generics is parsed must be 
reconstructed when it gets specialized. Think about declaring usual classes 
with the generic parameter replaced with actual type. If at that time, the 
operation < is not yet defined, the code won't compile anyway.

It is a pity. I think if fpc supports class operators, maybe this problem could 
be solved by using class helpers (my purpose is that users of ttreap class does 
not have to modify treap.pas) ? Is that possible in future FPC?

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to