You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm new here (I hope I posted in the right area).
I'm not sure how to pass a function as a parameter when that function is associated with a struct.
I have seen in the example how to do that when it is not associated with a struct, but it seems neater to do that with struct as well.
I use the benchmark in the example to illustrate this, but ideally, I want to do that generally, I don't need to do that at runtime but at compile time.
The below code errors at: _ = il.func() because func() is not defined in the struct. What would be the proper way to achieve that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm new here (I hope I posted in the right area).
I'm not sure how to pass a function as a parameter when that function is associated with a
struct
.I have seen in the example how to do that when it is not associated with a struct, but it seems neater to do that with
struct
as well.I use the benchmark in the example to illustrate this, but ideally, I want to do that generally, I don't need to do that at runtime but at compile time.
The below code errors at:
_ = il.func()
because func() is not defined in the struct. What would be the proper way to achieve that?Beta Was this translation helpful? Give feedback.
All reactions