4 ms·
It also depends a little bit on your style of programming. For example, in C code, I personally like using gcc extensions like nested functions. As far as I k
by kkylin 11y ago
It also depends a little bit on your style of programming. For example, in C code, I personally like using gcc extensions like nested functions. As far as I know this is not supported by clang (but perhaps someone more knowledgeble can chime in).
- Kristine1975 11y ago>nested functions They are not supported. In C++11 you can use lambdas: auto const local_func = [&](...) { ... }; And then later: local_func(...);
- CyberDildonics 11y agoNot only that but you can even create a struct inside a function and overload operator(). I don't know if this is possible in C++03 or not.
- Kristine1975 11y ago>I don't know if this is possible in C++03 or not. It is/was. It could be used to manually create a lambda function.
- lultimouomo 11y agoBut note that you cannot use such class as a template parameter, as it has no linkage. Which makes it mostly useless, since you usually want to use lambdas with templates. This restriction has been lifted in C++11.
- CyberDildonics 11y agoInside of a function too?
- kkylin 11y agoCool, thanks!