Do functions and/or function pointers have scope (or lifetimes)

WhatMeWorry via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 29 14:59:21 PST 2014


I'm assuming the answer is yes.

If so, that implies that I could execute a function pointer that 
doesn't point to anything meaningful. Conversely, functionality 
could exist that I can't get access to because my function 
pointer is unavailable?

If these are dangers, is there a technique or mechanism that I 
can use to always ensure that both these scenarios never happen.

Andrei's book mentions that reference types live forever (or 
something to that effect) as opposed to value types. So could I 
put functions and function pointers into Class objects?

Thanks.



More information about the Digitalmars-d-learn mailing list