-
Notifications
You must be signed in to change notification settings - Fork 258
[BUG] Captured functor requires parenthesis around it to be interpreted correctly. #1283
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
Comments
See also #748. |
Done? |
Should this I've been looking at this issue and it seems there are some cases where it's impossible to know what is the intent without checking the context. For example in this case: It is impossible to know unless we look at the type of I believe it is best to clarify the call by adding the necessary parenthesis Maybe the bug should be closed, otherwise it needs clarification on the next course of action. |
Describe the bug
When using a functor inside a lambda, e.g.
This fails with some incomprehensible error saying is not invocable.
But
std::ranges::generate(arr, :() (f&$*)(););
works fine.To Reproduce
Here's the code that fails (this is a toy example, ignore the bugs):
Here's the code that works:
I would have expected the first version to work, but failing that, I would have expected a better error message.
Here's the actual error message:
The text was updated successfully, but these errors were encountered: