On Friday, 17 December 2021 at 16:02:45 UTC, RazvanN wrote:

There is also a compiler trait [1] which can do that for you:

```d
void main()
{
    int val = 10;
    static if (__traits(isSame, typeof(val), int)) {}
}
```


[1] https://dlang.org/spec/traits.html#isSame

Thanks! The other options were simpler and faster to type tho

Reply via email to