1 - yes with the restriction that the class does not have a constructor or destructor 2 - yes
The following code aggregates are an example:
union MyUnion
{
class
{
public:
int a;
int b;
} anonym_access;
double align;
};
int main()
{
MyUnion u;
}
source
share