If you use clang, blocks are another approach.<p>[0] <a href="http://en.wikipedia.org/wiki/Blocks_(C_language_extension)" rel="nofollow">http://en.wikipedia.org/wiki/Blocks_(C_language_extension)</a><p>[1] <a href="http://clang.llvm.org/docs/BlockLanguageSpec.html" rel="nofollow">http://clang.llvm.org/docs/BlockLanguageSpec.html</a>