Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 765 Bytes

compiler-error-c3354.md

File metadata and controls

36 lines (26 loc) · 765 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3354
Compiler Error C3354
11/04/2016
C3354
C3354
185de401-231e-4999-a149-172ee4c69d84

Compiler Error C3354

'function' : the function used to create a delegate cannot have return type 'type'

The following types are invalid as return types for a delegate:

  • Pointer to function

  • Pointer to member

  • Pointer to member function

  • Reference to function

  • Reference to member function

The following sample generates 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();