Aliasing current function template instance
Adam D. Ruppe
destructionator at gmail.com
Fri May 1 21:05:17 UTC 2020
On Friday, 1 May 2020 at 20:28:58 UTC, Jean-Louis Leroy wrote:
> Something I have overlooked? Any ideas?
There's an old rule, that I can't find in the spec anymore but
I'm still pretty sure it is there, where taking the address of a
template inside a template yields the current instantiation.
Then you can fetch the type of that and do some reflection off.
So try this in your test rig:
pragma(msg, Parameters!(typeof(&foo)));
This rule was in there to ease callbacks and recursive functions
iirc but it can also work with you thanks to typeof turning the
runtime address back into a compile time alias.
More information about the Digitalmars-d-learn
mailing list