Vote UpVote

Operator Overloading in Delphi and C++

The Programming Works – Let us consider the following toy problem: implement a user-defined integer type MyInt which is assignment compatible with built-in signed and unsigned integers and supports addition. We assume here that all integers are 32-bit. Assigning unsigned integers above 0x7fffffff to MyInt and assigning negative MyInt values to unsigned integers should raise exceptions. To begin with we have a record (Delphi) type MyInt = record private FValue: Integer; end; or structure (C++) struct MyInt{ private: int FValue; }; By convention we use explicit conversion if a conversion can raise ...
Favorite? Off-Topic? Serg @ 2013-11-14 09:55


Visits: 7
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

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)