How long is a parameter (captured by value) within a lambda expression valid?
Is the parameter valid for the lifetime of the lambda itself, or is it only valid only for the duration of the call?
For example given this:
[value = 5] { DoSomething(&value) }
Does the &value
pointer remain valid after the lambda call has finished? (Of course assuming that the lambda itself is still alive.)
I’ve seen this similarly named question, but this deals with modifying the lambda inside the expression, not the lifetime.