3 ms·
I think the one key downside for std::function+lambda which resonated with me was bad ergonomics during debugging. My unanswered question on this from 8 years
by oezi 1y ago
I think the one key downside for std::function+lambda which resonated with me was bad ergonomics during debugging.
My unanswered question on this from 8 years ago:
https://stackoverflow.com/questions/41385439/named-c-lambdas-for-profiling-and-debugging https://stackoverflow.com/questions/41385439/named-c-lambdas...
If there was a way to name lambdas for debug purposes then all other downsides would be irrelevant (for most usual use cases of using callbacks).
- neobrain 1y ago> If there was a way to name lambdas for debug purposes then all other downsides would be irrelevant (for most usual use cases of using callbacks). Instead of fully avoiding lambdas, you can use inheritance to give them a name: https://godbolt.org/z/YTMo6ed8T https://godbolt.org/z/YTMo6ed8T Sadly that'll only work for captureless lambdas, however.
- zack-alex 1y ago[dead]