Is there a way to get the types of all template parameters?

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 4 06:50:01 PDT 2015


On Thursday, 4 June 2015 at 13:38:20 UTC, Atila Neves wrote:
> For regular runtime parameters, there's ParameterTypeTuple. How 
> would I write an equivalent template for template parameters? 
> i.e.
>
>     void fun(Foo foo, Bar bar)() {}
>
>     alias types = CtParameterTypeTuple!fun; //TypeTuple!(Foo, 
> Bar)
>
> I've tried but my is expression kung fu was weak.
>
> Atila

There is http://dlang.org/phobos/std_traits.html#TemplateArgsOf, 
but it only
works with an instantiated template.


More information about the Digitalmars-d-learn mailing list