當下列錯誤出現時,我正在編譯下面的代碼。我無法找到原因。錯誤:工會中不允許複製賦值運算符
typedef union {
struct {
const int j;
} tag;
} X;
int main(){
return 0;
}
error: member `<`anonymous union>::`<`anonymous struct> `<`anonymous union>::tag with copy assignment operator not allowed in union
此代碼編譯罰款與海灣合作委員會雖然。僅用g ++給出錯誤。