On 2011-06-17 19:58, Lloyd Dupont wrote:
> given
> ----
> A a = ....
> class A {}
> class B : A {}
> ----
> how could I test, at runtime, if "a" is just a "A" or is a "B"?
Cast it. The result will be null if the cast fails.
if(cast(B)a)
//it's a B
else
//it's an A but not a B
- Jonathan M Davis