DP News-Robot |
12. Apr 2014 20:10 |
Safe-casting Pointers
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 ... http://feeds.feedburner.com/~r/delph...~4/8akpZ74f9_M
More...
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:27 Uhr. |
|
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz