[Cs3] Cs3 lecture
Mikhail Nesterenko
mikhail at cs.kent.edu
Fri Feb 25 14:48:52 EST 2022
> I was wondering if it were possible to capture context by const references
> in lambda expressions.
Not easily. Here is a discussion of it on stack overflow:
https://stackoverflow.com/questions/3772867/lambda-capture-as-const-reference
And here is a discussion of alternatives to this approach
https://stackoverflow.com/questions/31179355/passing-by-constant-reference-in-the-lambda-capture-list
And here is a very detailed and intuitive discussion of Lambda
implementations in C++
https://www.learncpp.com/cpp-tutorial/lambda-captures/
Thanks,
--
Mikhail
More information about the cs3
mailing list