feature request: __traits(getTemplate, A!T) => A; __traits(getTemplateArguments, A!(T,"foo")) => (T,"foo")

anonymous anonymous at example.com
Sat Jun 22 17:56:36 PDT 2013


On Sunday, 23 June 2013 at 00:34:36 UTC, Timothee Cour wrote:
> there's also this case:
> template E8(T){
> struct B{}
> struct A{}
> }
>
> pragma(msg,__LINE__,":",getTemplate!(E8!(float))); => works 
> with template
> getTemplate(alias T : TI!TP, alias TI, TP...) specialization
>
> pragma(msg,__LINE__,":",getTemplate!(E8!(float).A)); =>  ??
> how to make the 2nd work?
>
> is there something like:
> template getTemplate(alias T : TI!TP.TE, alias TI, alias TE, 
> TP...) {...}
> available ?

E8!float.A itself is not a template instance, its parent is. I 
think it's correct for getTemplate to not compile in this case.

In the end, putting getTemplate!Foo and getTemplateArguments!Foo 
back together should lead to Foo again. I don't see what 
getTemplate!(E8!float.A) could return for that to hold.


More information about the Digitalmars-d mailing list