3 ms·
In your rust example could you give "a" a lifetime that is the same as the lifetime of the impl Fn that foo() returns? That way "a" lives as long as the impl Fn
by phibz 7y ago
In your rust example could you give "a" a lifetime that is the same as the lifetime of the impl Fn that foo() returns? That way "a" lives as long as the impl Fn.
- phibz 7y agoI tried changing a to a reference and doing: fn foo<'a>(a: &'a f64) -> impl Fn(f64) -> f64 + 'a { .... but it doesn't work