Initializing a union with a non-trivial constructor
Question 1: Default constructors do initialize POD members to 0 according to the C++ standard. See the quoted text below. Question 2: If a constructor must be specified in a base class, then that class cannot be part of a union. Finally, you can provide a constructor for your union: union U { A a; … Read more