Vote UpVote

On the operator overloading in Delphi

The Programming Works – The operator overloading in Delphi records is straightforward if a record type does not contain fields which reference heap objects. To illustrate the problem which heap references arise let us consider the following (incorrect) example: program DelphiDemo; {$APPTYPE CONSOLE} uses SysUtils; type Adder = record private FRef: PInteger; function GetMemory: Integer; procedure SetMemory(AValue: Integer); public procedure Init(AValue: Integer = 0); procedure Done; class operator Add(const A, B: Adder): Adder; property Memory: Integer read GetMemory write ...
Favorite? Off-Topic? Serg @ 2013-04-10 11:15


Visits: 1018
Votes: 4
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Jeroen Pluimers
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


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