编译器错误 C2570

“identifier”:联合不能有基类

联合派生自类、结构或联合。 这是不允许的。 改为将派生类型声明为类或结构。

以下示例生成 C2570:

// C2570.cpp
// compile with: /c
class base {};
union hasPubBase : public base {};   // C2570
union hasNoBase {};   // OK