Vote UpVote

Strange overloads

The Programming Works – Combining method overloading with implicit type conversion may lead to strange results. Consider the following innocent stub code for implementing a wrapper type for array of bytes: unit Unit1; interface uses SysUtils; type ByteArray = record class function Copy(const A: ByteArray; I: Cardinal): ByteArray; overload; static; class function Copy(const A: ByteArray; I, L: Cardinal): ByteArray; overload; static; function Copy(I: Cardinal): ByteArray; overload; function Copy(I, L: Cardinal): ByteArray; overload; class operator Implicit(const Value: LongWord): ByteArray; ...
Favorite? Off-Topic? Serg @ 2015-07-27 16:36


Visits: 1009
Votes: 0
Favorites: 0
Off-Topic: 1

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)