NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2668

'function' : ambiguous call to overloaded function

The specified overloaded function call could not be resolved. You may want to explicitly cast one or more of the actual parameters.

You can also get this error through template use. If, in the same class, you have a regular member function and a templated member function with the same signature, the templated one must come first. This is a limitation of the current implementation of Visual C++.

See Knowledge Base article Q240869 for more information on partial ordering of function templates.

If you are building an ATL project containing a COM object supporting ISupportErrorInfo, see Knowledge Base article Q243298.

Example

struct A {};
struct B : A {};
struct X {};
struct D : B, X {};

void func( X, X );
void func( A, B );
D d;
void main()
{
   func( d, d );        // error, D has an A, B, and X 
   func( (X)d, (X)d );  // OK, uses func( X, X )
}

If you encounter this error while porting code from Visual C++ 2.0 or earlier, see Technote: Improved Conformance to ANSI C++.