I have an pointer Base* base_ptr
to an polymorphic object. Is it possible to find out the size of the dynamic type of said object?
AFAIK, sizeof(*base_ptr)
yilds the size of the static type of base_ptr
. I'm beginning to suspect this isn't possible, but maybe I'm overlooking something.
Note: I'm aware that I could add a virtual function to my type hierarchy which returns the size, but this is not a desirable solution in my case.
EDIT: sizeof(base_ptr)
-> sizeof(*base_ptr)