Re: [fpc-devel] Operator overloading question: Impossible to overload assignment for equal types. Why?

2024-04-25 Thread Bart via fpc-devel
On Thu, Apr 25, 2024 at 2:17 PM Sven Barth via fpc-devel wrote: > Management operators are already part of 3.2.x ( > https://wiki.freepascal.org/FPC_New_Features_3.2.0#Management_operators_for_record_types > ). Or did I misunderstand your remark? 🤔 I misread the wiki page (it mentions 3.1.1 a

Re: [fpc-devel] Operator overloading question: Impossible to overload assignment for equal types. Why?

2024-04-25 Thread Sven Barth via fpc-devel
Bart via fpc-devel schrieb am Do., 25. Apr. 2024, 11:48: > > > Then declare a Copy management operator in the record. Unlike an > assignment operator these *must* be part of the record, thus the same rules > are applied for the same type everywhere unlike for operator overloads. See > also https:

Re: [fpc-devel] Operator overloading question: Impossible to overload assignment for equal types. Why?

2024-04-25 Thread Bart via fpc-devel
On Thu, Apr 25, 2024 at 11:18 AM Sven Barth via fpc-devel wrote: > If there exists a built-in operator then overloading that operator is > forbidden to avoid confusion when what operator might be used (operators can > after all be declared *anywhere* and thus they might sometimes be used and >

Re: [fpc-devel] Operator overloading question: Impossible to overload assignment for equal types. Why?

2024-04-25 Thread Sven Barth via fpc-devel
Bart via fpc-devel schrieb am Mi., 24. Apr. 2024, 11:59: > Overloading the := (assignment) operator for equal types is forbidden. > Out of curiosity I would like to know why that is? > If there exists a built-in operator then overloading that operator is forbidden to avoid confusion when what op