detect if a symbol is template
Igor Lesik
curoles at yahoo.com
Thu Feb 18 01:08:52 PST 2010
>Can anyone show me how to detect if a symbol is template?
>The following is not working:
>template A()
>{
>...
>}
>alias a A;
>static if(is (a == template)) // error
imo, it is not possible; template name is not a type
in this particular case, to check if a is alias for A, you may use:
A.stringof == a.stringof
-Igor
----- Original Message ----
From: Lirong <leon.li.lirong at gmail.com>
To: digitalmars-d at puremagic.com
Sent: Wed, February 17, 2010 10:18:43 PM
Subject: detect if a symbol is template
Hi,
Can anyone show me how to detect if a symbol is template?
The following is not working:
template A()
{
...
}
alias a A;
static if(is (a == template)) // error
Best regards
More information about the Digitalmars-d
mailing list