#"building" arguments for a function chosen at comptime

1 messages · Page 1 of 1 (latest)

uncut stag
#

@call takes a tuple for the args, there is std.meta.ArgsTuple(fn) to get a tuple type for the functions args, you can make an instance and fill it using reflection then pass it to @call

#

but that could be overkill, or too complex depending on your code.
the exampl you gave is perfectly fine for 3 possible types