what is the different bettwen typeid and .classinfo?

lilijreey lilijreey at 126.com
Mon Mar 30 14:38:25 UTC 2020


Hi:
    I write code like this
```D
class Base
{
int base;
}

class CC :Base
{
  int cc;
}

auto cc = new CC;

//I want check cc object type is CC
if (typeid(cc) == typeid(CC)) // ok ==

if (cc.classinfo == AstAssignNode) //error

if (cc.classinfo == AstAssignNode.classinfo) // ok ==
```


More information about the Digitalmars-d-learn mailing list