How to tell between int[] and int[]... with introspection?
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Feb 4 17:18:27 UTC 2021
Given these functions:
int func1(string x, int[] y);
int func2(string x, int[] y...);
Is there a way to tell, using compile-time introspection, the difference
between their signatures?
Using std.traits.Parameters shows both functions as having signature
(string, int[]).
typeof(&func2).stringof does show the `...` but I'd rather not rely on
parsing .stringof if at all possible.
T
--
Which is worse: ignorance or apathy? Who knows? Who cares? -- Erich Schubert
More information about the Digitalmars-d
mailing list