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

Atila Neves via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 4 08:35:10 PDT 2015


On Thursday, 4 June 2015 at 13:50:02 UTC, Meta wrote:
> 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.

Don't know how I missed that, thanks!

Atila


More information about the Digitalmars-d-learn mailing list