0
How to stop lambda modifying class member
Refer code below : I have a method of class which uses lambda and modifies member variable from lambda. This lambda has = as capture clause. I thought a should not be modified, but it allows modification. Do we have any mechanism which stops this modification? https://sololearn.com/compiler-playground/cqry108RT02o/?ref=app
1 Réponse
0
You can add access specifiers.
Also, a struct is meant for variables. How about you extract the methods out of it and put it in a class?