≈ the.bay.news

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

Sign in to join the discussion — your thebay.events account works here.

No comments yet.