[fpc-devel] Generic class comparison operators

Sven Barth pascaldragon at googlemail.com
Wed Apr 21 20:57:03 CEST 2021


Am 21.04.2021 um 15:44 schrieb Benito van der Zander via fpc-devel:
> Hi,
>
>  what about overloading operators for OBJECTs?
>
> They do not conflict with any default operators.
>
> I expected this to work, but it did not compile:
>
>
>   type generic TXQHashset<TKey, TInfo> = object //(specialize 
> TXQBaseHashmap<TKey,TXQVoid,TInfo>)...
>     class operator =(const a, b: TXQHashset): boolean;
>   end;

You can only use global operators with objects.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20210421/7a5f34a3/attachment.htm>


More information about the fpc-devel mailing list