2
votes
Vote UpVote

Safe-casting Pointers

The Delphi Geek – You cannot safe-cast a pointer. This will fail:ptr as TProjectYou can only cast pointers the unsafe way:TProject(ptr)That is, unless you use this neat trick:TObject(ptr) as TProjectThis will also catch programming errors, specifically a pointer that doesn’t point to an object. --- Published under the Creative Commons Attribution 3.0 license
Favorite? Off-Topic? gabr @ 2014-04-12 20:12

Statistics

Visits: 964
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Jørn E. Angeltveit
Zzzzz
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)