What does this do? Specifically, I have 3 fields out of 20 in ‘this’ object that I want to pass into the lambda. If I use [&] will it only take the 3 fields I use? And will they be passed by reference or value?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It specifies all (implicit) captures are captured by reference. That is, it behaves as if there exists a hidden reference member of the closure object, initialized by the actual captured object.
No, if you only capture members of the
thisobject, only thethispointer is captured (always by value).