编译器错误 C3839

无法更改托管或 WinRT 类型中的对齐方式

托管或 Windows 运行时类型中变量的对齐是由 CLR 或 Windows 运行时控制的,不能使用 align 进行修改。

下面的示例生成 C3839:

// C3839a.cpp
// compile with: /clr
ref class C
{
public:
   __declspec(align(32)) int m_j; // C3839
};

int main()
{
}