How to get number of parameters in lambda?

Adam D. Ruppe destructionator at gmail.com
Tue Mar 9 03:12:20 UTC 2021


On Tuesday, 9 March 2021 at 03:08:14 UTC, Paul Backus wrote:
> Yes, it's possible. For example:
>
> template fun(T) {

It'd be nice if we could at least get the arity of a template, 
then perhaps speculatively instantiate it and reflect on the 
eponymous function then.

(that's a lot of jargon lol but like some kind of reflection over 
template parameters is definitely possible... just the compiler 
doesn't offer any facilities for it at all. Then once you're past 
that layer you can start trying other things.)


More information about the Digitalmars-d-learn mailing list