Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Error C2620

member 'identifier' of union 'union' has user-defined constructor or non-trivial default constructor

A union member cannot have a default constructor.

The following sample generates C2620:

// C2620.cpp
class A {
   A();   // A has a default constructor
};
union U {
   A a;   // C2620
};
Show:
© 2015 Microsoft