How to write __traits(isSame, T, int) use another way

Adam D. Ruppe destructionator at gmail.com
Thu Aug 22 17:01:09 UTC 2019


On Thursday, 22 August 2019 at 16:54:56 UTC, lili wrote:
>    I think the __traits(isSame, T, int) syntax is too uglily,
>    Is where an other way rewrite it. like this 
> isSameType!(T,int)

For types you can (and often should) just use

is(T == int)


the isSame thing is more about comparing aliases rather than 
types.


More information about the Digitalmars-d-learn mailing list