Skip to content

"Clone" kind bound on closures and traits, with autogenerated clone implementation #2830

@bblum

Description

@bblum

A common idiom might be to create an arc or exclusive with a data structure inside, then spawn lots of worker tasks to walk over it. With #2829, it won't be possible to build a ~-closure and call it multiple times, since ARCs are noncopyable, since they need a special clone() interface.

Add a factory-style interface that uses a clone trait to enable this pattern without the user getting their hands dirty copying around everything in a closure's environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-trait-systemArea: Trait systemA-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions