Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error C2622

member 'identifier' of union 'union' has assignment operator

A union member cannot have an assignment operator.

The following sample generates C2622:

// C2622.cpp
class A {
   A& operator= ( const A& );  // A's assignment operator
};
union U {
   A a;   // C2622
};
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.