How to test templates for equality?

Uranuz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 30 22:58:18 PDT 2014


On Tuesday, 1 July 2014 at 05:51:17 UTC, Peter Alexander wrote:
> template Foo(T...) {}
> template Bar(T...) {}
>
> template isFoo(alias F)
> {
> 	enum isFoo = __traits(isSame, F, Foo);
> }
>
> pragma(msg, isFoo!Foo); // true
> pragma(msg, isFoo!Bar); // false

Thanks for quick response. I really forget to look into language 
__traits statement.


More information about the Digitalmars-d-learn mailing list