Union is far less likely to be used when we write programs than structs. So we often do not care about her, we know that he is using memory multiplexing technology. At the same moment, he can only have one member value. C, we can include structs in the union, but it's not the same in C + +. Especially when we use the class in the Union. For example, when using to CString, you will find that the program will error. The question made me very confused, and after reading some information I finally understood what was going on. The Union object is not constructed when it is created, but simply allocates memory. When we include a class in the Union, the class is going to be constructed, and the Union is not constructed, so that the resulting result, the object of the class is not created. This will cause an error.
C + + Union usage note