-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hi, I'm new to Rust - sorry if this is dumb, but I'm not finding a solution.
I have a function that is passed in and user-controlled, and it must be that way. My code will use that function extensively, and in some cases, will re-call the function with the same arguments many times.
The code would be much cleaner if I could memoize the input function, which would mean memoizing a closure that captures the input function. But this code:
#[memoize]
let dist_cached = |a: &usize, b: &usize| -> f32{
return my_dist(a, b);
};
Does not work.
Is there a way to do or support this kind of operation?
Metadata
Metadata
Assignees
Labels
No labels