共用方式為


編譯器錯誤 C3354

'function': 用來建立委派的函式不可以擁有傳回類型 'type'

下列類型作為 delegate的傳回類型時無效:

  • 函式的指標

  • 成員的指標

  • 成員函式的指標

  • 函式的參考

  • 成員函式的參考

下列範例會產生 C3354:

// C3354_2.cpp
// compile with: /clr /c
using namespace System;
typedef void ( *VoidPfn )();

delegate VoidPfn func(); // C3354
// try the following line instead
// delegate  void func();