Clone for closures


With unboxed closures, would there be any possiblity of deriving Clone for all closures, that only close over values that implements clone themselves?

Specifically I do not see any reason why this should not work:

fn main() {
    let k = 42i;
    let foo = |n: int| -> int n+k;
    let bar = foo.clone();

That would make e.g. possible.

Cloning of closures
closed #2

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.