4 ms·
I disagree. It's easier to comprehend the scope and lifetime of bound variables and lambdas if you already know them from normal objects. I had a hard time to g
by emsy 12y ago
I disagree. It's easier to comprehend the scope and lifetime of bound variables and lambdas if you already know them from normal objects. I had a hard time to grasp the lifetime of my lambdas and how the variables were bound, stored and passed to a function.
Of course, C++ is hugely impacted by its legacy burden. Any newer language would probably do it in a simpler way. Still, the fact that lambdas and objects use the same scope makes things much easier to understand remember.