[Lazarus] "global" operator overloading

xrfang xrfang at gmail.com
Tue Feb 26 08:58:46 CET 2013


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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130226/ab9fe682/attachment-0003.html>


More information about the Lazarus mailing list