Pass inline function as argument
Ziggit
Pass inline function as argument
Is it possible to create an inline function as parameter? pub fn first(self: @This(), predicate: fn(element: Element) bool) void { // use predicate here } Callsite: query.first( fn(e: Element) { return e.x > 42; } // inline function ); I know we can use a local struct containing the function or just call a global function and pass that.
0 comments
No comments yet.