3 ms·
I see from the below link that the ‘STAR this’ pointer would be captured implicitly by reference in this case. This happens regardless of a default capture type
by 0db532a0 8y ago
I see from the below link that the ‘STAR this’ pointer would be captured implicitly by reference in this case. This happens regardless of a default capture type if it does exist.
To truly capture a member by value, you can (1) make a copy of that value in the enclosing function, thus making it an automatic variable which can be value-captured, (2) value-capture through an initialiser in the capture list or (3) you can indicate ‘STAR this’ (since C++17) as a capture, which then captures the ‘this’ as a value copy and thus transitively your member.
https://en.cppreference.com/w/cpp/language/lambda#Lambda_capture https://en.cppreference.com/w/cpp/language/lambda#Lambda_cap...