2011/1/20 Alex Shishkin <[email protected]>: > Following code causes error "Operator is not overloaded: "TObject" < > "TObject"" > How to make it work? > > program generictest2; > {$mode objfpc}{$H+} > uses > fgl; > operator < (a: TObject; b: TObject): boolean; > begin > result := PtrInt(a) < PtrInt(b); > end; > type > TMyMap = specialize TFPGMap <TObject, TObject>; > begin > end. AFAIK TFPGMap can be specialized only with types which have the relational operators predefined by the compiler. See also: http://bugs.freepascal.org/view.php?id=15480
You can take a look on this container lib, which might be helpful for your task: http://code.google.com/p/fprb/wiki/heContnrs -- bflm freepascal-bits.blogspot.com _______________________________________________ fpc-pascal maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-pascal
