Einzelnen Beitrag anzeigen

Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
14.980 Beiträge
 
#1

Safe-casting Pointers

  Alt 12. Apr 2014, 20:10
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 ...

More...
  Mit Zitat antworten Zitat