6
votes
Vote UpVote

Class Operators in Delphi

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 ...
Favorite? Off-Topic? marcocantu @ 2013-03-28 20:30

Statistics

Visits: 1455
Votes: 6
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Barton_Stano
Emrah KUCUKALI
Jeroen Pluimers
Ravaut123
Wouter
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)