digitalmars.D.learn - Getting a TypeTuple of a Template's Arguments
- Meta (2/2) Aug 17 2015 For functions, we have std.traits.ParameterTypeTuple. Is there
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (18/19) Aug 17 2015 Aside: With 2.068, std.typetuple and TypeTuple are renamed as std.meta
- thedeemon (3/5) Aug 18 2015 I've recently searched for this thing and haven't found anything
- Meta (3/8) Aug 18 2015 As I'd thought. I can't think of a way to do it, either, so I
For functions, we have std.traits.ParameterTypeTuple. Is there any equivalent functionality for templates?
Aug 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 anyequivalent 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
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
On Tuesday, 18 August 2015 at 07:41:00 UTC, thedeemon wrote:On Monday, 17 August 2015 at 21:23:49 UTC, Meta wrote: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.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