On 10/17/2011 1:24 PM, Daniel Gibson wrote:
What about function-like macros, e.g. the Linux/POSIX cmsg stuff
(CMSG_FIRSTHDR(), CMSG_NXTHDR(), CMSG_LEN() etc) needed to use functions like
recvmsg() and sendmsg()?
Will there be a direct D translation of the functionality or will they be
omitted completely?
Consider:
#define FOO(x) bar((x) + 1)
Do this:
int FOO()(int x) { return bar(x) + 1; }
Note that it's a function template with no template parameters. This will enable
it to be "header only" and not require linking to some library to resolve FOO().