[fpc-devel] Operator overloading and {$mode delphi}

Sven Barth pascaldragon at googlemail.com
Sun Apr 14 19:44:17 CEST 2019


Am 14.04.2019 um 17:21 schrieb Bart:
> On Sun, Apr 14, 2019 at 8:26 AM Michael Van Canneyt
> <michael at freepascal.org> wrote:
>
>> I added a table with the delphi operator names, mentioned that they can be
>> used in operator definitions, but that they must be used in Delphi mode.
> If I understand the delphi documentation correctly the you can only
> overload operaters using class methods for records or classes?
> So, you cannot overload an operator to add an ordinal to a string
> (which we can in fpc).
Correct. Delphi does not support global overloads. I know that it's a 
bit inconsistent that we allow some FPC features in mode Delphi and some 
not, but the main idea of mode Delphi is to allow the compilation of 
Delphi code.

Regards,
Sven



More information about the fpc-devel mailing list