Re: Are function pointers compile time constants?

2011-02-26 Thread Dan Olson
d coder writes: > Greetings > > I tried to initialize a struct member with a function pointer, and > found that DMD2 did not like it. Are not function pointers compile > time constants? And why they should not be? > > Regards > - Cherry I just want to point out that this *should* be doable in D.

Re: Are function pointers compile time constants?

2011-02-22 Thread Kagamin
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 me

Re: Are function pointers compile time constants?

2011-02-21 Thread Simon
On 21/02/2011 00:24, Steven Schveighoffer wrote: On Sun, 20 Feb 2011 16:23:14 -0500, Nick Sabalausky wrote: "Simon" wrote in message news:ijrdif$1nn6$1...@digitalmars.com... On 20/02/2011 14:59, d coder wrote: Greetings I tried to initialize a struct member with a function pointer, and fou

Re: Are function pointers compile time constants?

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 16:23:14 -0500, Nick Sabalausky wrote: "Simon" wrote in message news:ijrdif$1nn6$1...@digitalmars.com... On 20/02/2011 14:59, d coder wrote: Greetings I tried to initialize a struct member with a function pointer, and found that DMD2 did not like it. Are not function poi

Re: Are function pointers compile time constants?

2011-02-20 Thread Nick Sabalausky
"Simon" wrote in message news:ijrdif$1nn6$1...@digitalmars.com... > On 20/02/2011 14:59, d coder wrote: >> Greetings >> >> I tried to initialize a struct member with a function pointer, and >> found that DMD2 did not like it. Are not function pointers compile >> time constants? And why they shoul

Re: Are function pointers compile time constants?

2011-02-20 Thread d coder
Thanks Simon.

Re: Are function pointers compile time constants?

2011-02-20 Thread Simon
On 20/02/2011 14:59, d coder wrote: Greetings I tried to initialize a struct member with a function pointer, and found that DMD2 did not like it. Are not function pointers compile time constants? And why they should not be? Regards - Cherry No a function doesn't have an address until the .exe

Are function pointers compile time constants?

2011-02-20 Thread d coder
Greetings I tried to initialize a struct member with a function pointer, and found that DMD2 did not like it. Are not function pointers compile time constants? And why they should not be? Regards - Cherry