Re:Goals and Priorities for C++
by cordenr on Friday May 22, 2020 @04:16AM
(#23269764)
Virtual inheritance changes the order that sub-objects are constructed and destructed. This might be used where a base class manages the lifetime of a resource and other types in the hierarchy operate on that - and so need the resource to be "alive" even during their destruction.
[ Parent
| on HN ]
> This might be used where a base class manages the lifetime of a resource and other types in the hierarchy operate on that - and so need the resource to be "alive" even during their destruction.
Confused, isn't that already the case normally? Base classes are already destroyed after derived classes, and owning pointers die before their targets.