编译器错误 C3755
“delegate”:不能定义委托
可以声明 delegate(C++ 组件扩展),但不能定义它。
示例
以下示例生成 C3755。
// C3755.cpp
// compile with: /clr /c
delegate void MyDel() {}; // C3755
如果尝试创建委托模板,也会发生 C3755。 以下示例生成 C3755。
// C3755_b.cpp
// compile with: /clr /c
ref struct R {
template<class T>
delegate void D(int) {} // C3755
};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈