Skip to content
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

Capturing closures in mapping macros #31

Open
michaelsproul opened this issue Sep 29, 2023 · 0 comments
Open

Capturing closures in mapping macros #31

michaelsproul opened this issue Sep 29, 2023 · 0 comments

Comments

@michaelsproul
Copy link
Member

Currently superstruct uses a fn type for the closure passed to a mapping macro, meaning that variables can't be captured.

The reason we use fn is that it's a reliable type-hint that helps disambiguate things for the compiler. It would be interesting to investigate alternatives, like hinting only on the arguments/return value, or using something like a const or static assert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant