编译器错误 C3461

“type”:仅可转发托管类型

注解

类型转发只会在 CLR 类型上发生。 有关详细信息,请参阅类和结构

有关详细信息,请参阅转发类型 (C++/CLI)

Example

以下示例创建组件。

// C3461.cpp
// compile with: /clr /LD
public ref class R {};

以下示例生成 C3461。

// C3461b.cpp
// compile with: /clr /c
#using "C3461.dll"
class N {};
[assembly:TypeForwardedTo(N::typeid)];   // C3461
[assembly:TypeForwardedTo(R::typeid)];   // OK