I wrote order of destruction and even quoted standard several times.
When B is destroyed:
1) B destructor body is executed. It is empty: do not do anything
2) Destructors for all B members are called. There is none, do nothing
3) Destructor for vector is called
3.1) vector destructor body is executed. It is empty: do not do anything
3.2) Destructors for all vector members are called. There is none, do nothing
Finish
If you delete it through pointer to base class (vector), due to non-virtual destructor compiler will assume that vector is the final type and only step 3 is executed, leavind first two incomplete. This is why it causes Undefined Behavior.
YOu are correct here. I cast it to reference because I felt like doing so, but you can even cast a pointer, and it would work as long as you will make it unambiguous: ptr = (Receiver*)&radio;
I have read that you can just do dynamic_cast from pointer or reference which belongs to polymorphic classes. A polymorphic class is consider when it contains a virtual function...it doesn't have relation with base virtual class...