Can you use RTTI to determine a union member?
Christian Kamm
kamm.incasoftware at shift-at-left-and-remove-this.de
Tue Oct 16 08:37:16 PDT 2007
> if A, B and C are classes then you can uses
>
> (cast(A)(cast(Object)u.b) !is null)
> (cast(B)(cast(Object)u.c) !is null)
> (cast(C)(cast(Object)u.a) !is null)
If A, B, C are classes, you could also check with
u.a.classinfo is A.classinfo
u.a.classinfo is B.classinfo
u.a.classinfo is C.classinfo.
Christian
More information about the Digitalmars-d
mailing list