Thank you grumbel and yrro, I get it. I'm used to write things like [&userId]() and was ignorant of "implicit" capture.
Is there a benefit to the explicit version or is this purely a stylistic matter?
Is there a benefit to the explicit version or is this purely a stylistic matter?
That said, I usually use implicit because if I'm writing a lambda it's in a highly local context where a) it's just a shortcut, b) I know exactly what I'm doing, and c) it's not really meant for usability.
If you want to make the intent really explicit and rigid, it might even be better to use a structured capturing type with an operator(): `MyCapture{.x = x, .y = y}()` or whatever.