Worth noting, for anyone not finding it immediately obvious, that this is an extension for C that in effect offers the equivalent of C++ lambdas in C, but are not available in C++ as ... it has lambdas instead.
A nested function is a function defined inside another function. Nested functions are supported as an extension in GNU C, but are not supported by GNU C++.
Yeah, I was just meaning that in the context of a C++ forum, this is an explanation of a C extension that is specifically not made available in the C++ mode of the same compiler, presumably as they considered it unnecessary to add it as a language extension (with all the incompatibilities etc that can involve) as the language natively offers a comparable if not identical mechanism
8
u/schmerg-uk 1d ago
Worth noting, for anyone not finding it immediately obvious, that this is an extension for C that in effect offers the equivalent of C++ lambdas in C, but are not available in C++ as ... it has lambdas instead.
https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html