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

2019-08-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 22 August 2019 at 17:05:49 UTC, lili wrote: Thanks alot, How to get a variable's type? typeof(c)

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

2019-08-22 Thread lili via Digitalmars-d-learn
On Thursday, 22 August 2019 at 17:01:09 UTC, Adam D. Ruppe wrote: 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

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

2019-08-22 Thread Adam D. Ruppe via Digitalmars-d-learn
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 aliase

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

2019-08-22 Thread lili via Digitalmars-d-learn
Hi: I think the __traits(isSame, T, int) syntax is too uglily, Is where an other way rewrite it. like this isSameType!(T,int)