[Lazarus] "global" operator overloading

xrfang xrfang at gmail.com
Tue Feb 26 08:05:52 CET 2013


Hi There,

Days ago I posted a message about compiling error related to operator overloading. I found the reason now, but don't know how to fix that.  The code is:

=========

uses Classes, treap;

type
  TSLCounter = specialize TTreap<TStringList, Integer>;

operator <(sl1, sl2: TStringList): Boolean;

=========

The compiler complains about "<" is not defined for string list.  If I put the operator overloading into treap.pas, there is no problem.

Is there anyway to avoid this dilemma?  Because I don't want treap.pas to "reversely" rely on a specialized class.

Thanks,
Shannon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130226/8f84e680/attachment-0002.html>


More information about the Lazarus mailing list