www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Getting a TypeTuple of a Template's Arguments

reply "Meta" <jared771 gmail.com> writes:
For functions, we have std.traits.ParameterTypeTuple. Is there 
any equivalent functionality for templates?
Aug 17 2015
next sibling parent =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
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
Aug 17 2015
prev sibling parent reply "thedeemon" <dlang thedeemon.com> writes:
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.
Aug 18 2015
parent "Meta" <jared771 gmail.com> writes:
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.
Aug 18 2015