In C# you can do something like:

    if (obj is Person)
    {
        var person = obj as Person;
        // do stuff with person...
    }

where you can check the type of an object prior to casting. Does D have a similar mechanism? It's so widely useful in the C# realm that they even added syntactic sugar to allow:

    if (obj is Person person)
    {
        // do stuff with person...
    }

I would presume since D has reference objects there must exist some mechanism for this...

Reply via email to