Marco's Tech Blog – Delphi coming ARM compiler (for iOS) will add a nice feature to the language. Operators overloading for classes, a feature that is currently only for records. This means you can write a class like this: type TNumber = class private FValue: Integer; procedure SetValue(const Value: Integer); public property Value: Integer read FValue write SetValue; class operator Add (a, b: TNumber): TNumber; class operator Implicit (n: TNumber): Integer; end; And use it as follows: a, b, c: TNumber; ... c := a + b; ShowMessage (IntToStr (c)); This new feature ...
Visits by Source
Users who voted for this posting