macleivo wrote: As of c++20, you can reassign a lambda variable, if it meets certain conditions. See https://godbolt.org/z/zGefTo9G4 The standard says > If no captures are specified, the closure type has a defaulted copy > assignment operator and a defaulted move assignment operator. Otherwise, it > has a deleted copy assignment operator (this includes the case when there is > a capture-default , even if it does not actually capture anything). https://en.cppreference.com/w/cpp/language/lambda.html
I do see your point though @vbvictor as I do think it is extremely rare that one reassigns a lambda variable. However, in my case I'd prefer lambdas to be checked too. My reasons are consistency with other variables (this is my biggest reason), and the fact that lambdas can at least technically be reassigned. But if lambda checking is set to off by default, I'm okay with it if there's a toggle to turn it on manually. https://github.com/llvm/llvm-project/pull/157319 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
