Saturday, November 27, 2010

Unions

Any of the following disqualifies a class for being an element of a union: having a constructor, having a destructor, having a copy operation.

Otherwise the compiler would not know what constructor/destructor/copy operation to call.

Reference: The C++ Programming Language by Bjarne Stroustrup. Addison-Wesley, 2000. Section:C.8.3

No comments:

Post a Comment