5 ms·
GNU c can have lambda expressions[1]. And clang does even have closures[2]. 1: http://walfield.org/blog/2010/08/25/lambdas-in-c.html http://walfield.org/blog/
by earenndil 7y ago
GNU c can have lambda expressions[1]. And clang does even have closures[2].
1: http://walfield.org/blog/2010/08/25/lambdas-in-c.html http://walfield.org/blog/2010/08/25/lambdas-in-c.html
2: https://en.wikipedia.org/wiki/Blocks_(C_language_extension) https://en.wikipedia.org/wiki/Blocks_(C_language_extension)
- saagarjha 7y agoNote that the first example relies on multiple GCC-only features, one of which is the atrocity that is nested functions, and even then technically invokes undefined behavior.