amazing function behavior
adam.chrapkowski at gmail.com
Tue Oct 20 08:14:26 PDT 2009
> It isn't. Tfunc2 is a function pointer, which is typically the same as
> size_t. So any int can be stored inside it. It's generally a very bad
> idea to do so, of course.
Never mind what is stored inside func2. 0x00 is only to simplify the code.
Tfunc1 - pointer to function without args
Tfunc2 - pointer to function with 1 arg
func2 = cast(Tfunc1)something;
doesn't have a sense, because type of func2 is Tfunc2 type not Tfunc1!
In D1 this causes compilation error, but DMD2.035 doesn't generate any compilation message, even warning.
More information about the Digitalmars-d-learn