d coder <[email protected]> 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. At compile time the function's address in the object code is a placeholder that the linker or loader will fixup based on the function symbol. This is what linkers do! And if an function ptr is used, the function can still be inlined; just need to keep around the real function reference through the pointer. Dan
