Thread overview
Getting a TypeTuple of a Template's Arguments
Aug 17, 2015
Meta
Aug 17, 2015
Ali Çehreli
Aug 18, 2015
thedeemon
Aug 18, 2015
Meta
August 17, 2015
For functions, we have std.traits.ParameterTypeTuple. Is there any equivalent functionality for templates?
August 17, 2015
Aside: With 2.068, std.typetuple and TypeTuple are renamed as std.meta and AliasSeq, respectively.

On 08/17/2015 02:23 PM, Meta wrote:> For functions, we have std.traits.ParameterTypeTuple. Is there any
> equivalent functionality for templates?

There is TemplateArgsOf for instances of templates but I don't know anything more meta :) than that:

import std.traits;

void foo(int i, alias f, T)()
{}

void main()
{
    int bar(int) { return 0; }

    alias f = foo!(42, bar, int);
    pragma(msg, TemplateArgsOf!(f));
}

Prints

tuple(42, bar, (int))

Ali

August 18, 2015
On Monday, 17 August 2015 at 21:23:49 UTC, Meta wrote:
> For functions, we have std.traits.ParameterTypeTuple. Is there any equivalent functionality for templates?

I've recently searched for this thing and haven't found anything for uninstantiated templates, only for instantiated.
August 18, 2015
On Tuesday, 18 August 2015 at 07:41:00 UTC, thedeemon wrote:
> On Monday, 17 August 2015 at 21:23:49 UTC, Meta wrote:
>> For functions, we have std.traits.ParameterTypeTuple. Is there any equivalent functionality for templates?
>
> I've recently searched for this thing and haven't found anything for uninstantiated templates, only for instantiated.

As I'd thought. I can't think of a way to do it, either, so I guess that's a no-go for the time being.