Error del compilador C3272
'symbol': el símbolo requiere FieldOffset, ya que es miembro de tipo nombredetipo definido con StructLayout(LayoutKind::Explicit)
Cuando StructLayout(LayoutKind::Explicit)
está activo, los campos deben estar marcados con FieldOffset
.
El ejemplo siguiente genera la advertencia C3272:
// C3272_2.cpp
// compile with: /clr /c
using namespace System;
using namespace System::Runtime::InteropServices;
[StructLayout(LayoutKind::Explicit)]
ref struct X
{
int data_; // C3272
// try the following line instead
// [FieldOffset(0)] int data_;
};