Is unpacking variadic arguments coming soon?
At the moment, variadic arguments can be passed to other functions via
VariadicList
and the like. However, this approach fails if the second function is more general. An example:
Here, args
is a VariadicList
and cannot be passed as VariadicListMem
. Using VariadicListMem
in func2
does not work, however, since Stringable
is not register passable. Making a register passable Stringable
trait, in turn, is not possible, because AnyTrivialRegType
is not trait and cannot be inherited from.
I run into a similar issue if I use the (actually preferred) version that is fully parametric:
Here, the general function cannot take the more specific variadic pack.
I understand if everyone is tired of the "when will XY be implemented" questions. However, for me the question is whether I have to build a big workaround (if it takes longer) or simply use duplicate code (if this can be fixed soon).
Any advice (or alternative solutions)?0 Replies