Skip to content

Capturing closures in mapping macros #31

@michaelsproul

Description

@michaelsproul

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions