Compiler Error C3375

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3375.

function' : ambiguous delegate function

A delegate instantiation could have been to a static member function, or as an unbound delegate to an instance function, so the compiler issued this error.

For more information, see delegate (C++ Component Extensions).

The following sample generates C3375.

// C3375.cpp  
// compile with: /clr  
ref struct R {  
   static void f(R^) {}  
   void f() {}  
};  
  
delegate void Del(R^);  
  
int main() {  
   Del ^ a = gcnew Del(&R::f);   // C3375  
}  

Show: