编译器错误 C3280

“class”: 无法将托管类型的成员函数编译成非托管函数

托管的类成员函数不能编译为非托管函数。

以下示例生成 C3280:

// C3280_2.cpp
// compile with: /clr
ref struct A {
   void func();
};

#pragma managed(push,off)

void A::func()   // C3280
{
}

#pragma managed(pop)