Thread overview | |||||
---|---|---|---|---|---|
|
March 26, 2011 is(T : long) vs is(T == long) | ||||
---|---|---|---|---|
| ||||
What is the difference between this: template isNumerik(T){ enum bool isNumerik = is(T : long) || is(T : real); } and this: template isNumerik(T){ enum bool isNumerik = is(T == long) || is(T == real); } They both work and I can't find anywhere in the book where it talks about the : |
March 26, 2011 Re: is(T : long) vs is(T == long) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Caligo | On 3/26/11 12:36 PM, Caligo wrote: > What is the difference between this: > template isNumerik(T){ > enum bool isNumerik = is(T : long) || is(T : real); > } > > and this: > > template isNumerik(T){ > enum bool isNumerik = is(T == long) || is(T == real); > } > > > They both work and I can't find anywhere in the book where it talks about the : When in doubt, RTFM: http://digitalmars.com/d/2.0/expression.html#IsExpression (Using the colon allows implicit conversion, while == requires the types to be exactly the same) David |
March 26, 2011 Re: is(T : long) vs is(T == long) | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | :-) thanks. |
Copyright © 1999-2021 by the D Language Foundation