Are function pointers compile time constants?

Kagamin spam at here.lot
Tue Feb 22 06:16:23 PST 2011


Simon Wrote:

> You could make function pointers compile time constants if:
> 
> You disallow ASR
> You disallow them when compiling to a dll
> You disallow in-lining of any function of which you take the address
> You disallow the linker from rearranging functions
> You disallow the linker from merging duplicate functions.
> You merge the compiler and linker

Interestingly, this data layout is impossible without rearranging:

byte a;
byte[&c] b;
byte c;


More information about the Digitalmars-d-learn mailing list