Is a Union Member’s Destructor Called
In your example that you provided str will not be destructed. The standard states in [class.union]/2 A union can have member functions (including constructors and destructors), but not virtual (10.3) functions. A union shall not have base classes. A union shall not be used as a base class. If a union contains a non-static data … Read more