Hello,
I'm trying out the TGComparableBinHeapMin class from the LGenerics package.
This requires that the type used in the queue has defined the comparison operator <
So I have
type
TMyType = record
someProperty:integer;
end;
operator < (a, b: TMyType): Boolean;
and then in the implementation
var
pq__: specialize TGComparableBinHeapMin<TMyType>;
operator < (a, b: TMyType): Boolean;
begin
result:= a.someProperty < b.someProperty;
end;
Unfortunately the compiler complains that
lgpriorityqueue.pas(1004,15) Error: Operator is not overloaded: "TMyType" < "TMyType"
I've. not tried operator overloading before so it's entirely possible I'm doing something very obvious but if anyone could point me in the correct direction it would be appreciated!
Thanks
John C