feature request: __traits(getTemplate, A!T) => A; __traits(getTemplateArguments, A!(T,"foo")) => (T,"foo")
Timon Gehr
timon.gehr at gmx.ch
Sat Jun 22 16:18:17 PDT 2013
On 06/23/2013 01:03 AM, Dicebot wrote:
> http://dpaste.1azy.net/22d5eee2
>
> ------------------------------------
>
> import std.traits;
>
> template getTemplate(T)
> {
> static if (is(T == TI!TP, alias TI, TP))
> {
> alias getTemplate = TI;
> }
> else
> static assert (false);
> }
>
> private struct A(T)
> {
> T x;
> }
>
> pragma( msg, fullyQualifiedName!(getTemplate!(A!int)) );
>
> void main()
> {
> }
Only works for types.
More information about the Digitalmars-d
mailing list