Fake anonymous functions in C

后端 未结 3 1055
孤独总比滥情好
孤独总比滥情好 2021-02-05 15:23

In this SO thread, Brian Postow suggested a solution involving fake anonymous functions:

make a comp(L) function that returns the version of comp for arra

3条回答
  •  我寻月下人不归
    2021-02-05 16:24

    I don't believe you can do that with C99 -- there's no partial application or closure facility available unless you start manually generating machine code at runtime.

    Apple's recently proposed blocks would work, though you need compiler support for that. Here's a brief overview of blocks. I have no idea when/if any vendor outside apple will support them.

提交回复
热议问题