using __traits to get line number of a member

Stanislav Blinov stanislav.blinov at gmail.com
Sun Nov 14 04:24:09 UTC 2021


On Sunday, 14 November 2021 at 04:05:45 UTC, forkit wrote:

> However, there is no isClass method. Why not?
>
> How do I determine if a member is a class.. I wonder...

```
static if (is(something == class)) { /* ... */ }
```

or, if member is an instance

```
static if (is(typeof(something) == class)) { /* ... */ }
```

Ditto for interfaces, structs, unions.


More information about the Digitalmars-d-learn mailing list