编译器错误 C3353

“delegate”: 委托只能从全局函数或者托管或 WinRT 类型的成员函数中创建

使用 delegate 关键字声明的委托只能在全局范围内声明。

以下示例生成 C3353:

// C3353.cpp
// compile with: /clr
delegate int f;   // C3353