View previous topic :: View next topic |
Author |
Message |
nicfellows
Joined: 13 May 2004 Posts: 1 Location: Newcastle
|
Posted: Thu May 13, 2004 5:54 am Post subject: D equiv - typedef of a function pointer |
|
|
Hi
I am trying to convert a C header to a D module, mainly to get some D experiance. I have come up against a typedef to a function pointer and dont know how to code it.
The expression is like this:
Code: | typedef int (*func_name)(struct a_type *arg1, struct a_type *arg2); |
Can anyone help, or point me to info? I cant seem to find anything similar in the tutorials.
Thanks
Nic |
|
Back to top |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Thu May 13, 2004 6:11 am Post subject: Re: D equiv - typedef of a function pointer |
|
|
nicfellows wrote: | Code: | typedef int (*func_name)(struct a_type *arg1, struct a_type *arg2); |
|
It becomes...
Code: | alias int function(a_type*, a_type*) func_name; |
Just replace 'alias' with 'typedef' if you want it strongly typed. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
|
|