Given that there are the following struct types:
struct A {};
struct B : A {};
struct C : A {};
struct D : B {};
And we have a piece of code:
A a = f();
How would you check what type the struct actually is? i.e. is it A
, B
, C
or D
?
I can give the context in which I'm trying to use the answer for this if needed, but I don't think that's needed.