New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expr.prim.lambda.closure] Conversion to function pointer doesn't account for explicit object parameter CWG2561 #5294
Comments
IIUC the explicit object parameter could be used in the lambda-expression. E. g. struct C {
C(auto);
void f();
};
auto lambda = [](this C c) { c.f(); }; // OK? IIUC if the conversion function excludes the explicit object parameter, then the above |
Sounds like non-editorial CWG issue material to me. |
Yeah, definitely. I just wasn't sure if you preferred me emailing Core or posting it here. And per @cpplearner's comment, the wording may not even be wrong 😄. Yeah, with some more thought, |
But I think we still need to change
as it's not clear what that would mean, e.g.
( |
Why is |
Paragraphs 8 and 9 talk about what kind of function pointer a capture-less lambda is convertible to:
and
Those aren't quite right in the case of an explicit object parameter. Since this should probably work:
For the non-generic case, something like this:
Though wording this for the generic case is trickier since we need to skip the invented template parameter of the explicit object parameter, which might hypothetically also be used by some other parameter?
The text was updated successfully, but these errors were encountered: