Why does a struct, that has another struct wrapped in a union as a member not compile without an explicit default constructor?
问题 This is the relationship I am talking about: struct A{ int i = 1; }; struct B{ union{A a;}; }; void main(){ B b; }; In this constellation, my compiler (vs2015) complains about the default constructor of B B::B(void) beeing deleted, with the note that the compiler has generated B::B : ../test.cpp(155): error C2280: "B::B(void)" : Es wurde versucht, auf eine gelöschte Funktion zu verweisen ../test.cpp(152): note: Compiler hat hier "B::B" generiert (sorry, I could not convince msvc to talk