Compiler Error C3066
Collapse the table of content
Expand the table of content

Compiler Error C3066


there are multiple ways that an object of this type can be called with these arguments

The compiler detected an ambiguous function call involving surrogates.

The following sample generates C3066:

// C3066.cpp
template <class T, class U> void func(T*, U*){}

typedef void (*PF)(const int*, const char*);
typedef void (*PF1)(const int*, volatile char*);

struct A {
   operator PF() const {
      return func;

   operator PF1() {
      return func;

   operator PF1() const  {
      return func;


int main() {
   A a;
   int i;
   char c;

   a(&i, &c);   // C3066
   a(&i, (const char *) &c);   // OK
© 2015 Microsoft