5 ms·
> This problem doesn't arise with C++ lambdas because you pass them around as special objects, not as bare function pointers. If they don't capture anything, I
by einpoklum 8d ago
> This problem doesn't arise with C++ lambdas because you pass them around as special objects, not as bare function pointers.
If they don't capture anything, I believe you _can_ pass them as bare function pointers.
- lpribis 8d agoSure, but in that case they are equivalent to a static function so there's no benefit of lambda other than syntax sugar.
- 6yyyyyy 8d agoThe benefit is that you don't have to solve one of the hard problems in computer science (naming things).
- moxxymiller 8d agoCapturing lambdas in a language without a GC (or a borrow checker) are kinda fraught with footguns.
- uecker 7d agoThis is not my experience.