> Callbacks by definition create multiple paths to the data.
How come, when you have a struct method, accessing field members only visible to that specific method.
Something that is very easy to do with moving in lambda contexts in C++.
How come, when you have a struct method, accessing field members only visible to that specific method.
Something that is very easy to do with moving in lambda contexts in C++.
You can alternatively move the struct or its fields into the closure, but then you lose the first path. I know you're not doing that because if you were you wouldn't be having lifetime problems (and you wouldn't be able to share the state across event handlers, so it's not a great solution anyway).
It is related to closure desugaring.
https://github.com/nikomatsakis/nll-rfc/blob/master/0000-non...