C#'s 'is' equivalent in D

Adam D. Ruppe destructionator at gmail.com
Thu Oct 10 15:53:20 UTC 2019


On Thursday, 10 October 2019 at 15:47:58 UTC, Just Dave wrote:
>     if (obj is Person person)

Looks the same as D's

if(auto person = cast(Person) obj) {
   // use person in here
} else {
   // it was some other type
}



More information about the Digitalmars-d-learn mailing list