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 C2434

'identifier' : cannot convert default argument from 'type1' to 'type2'

A default parameter could not be converted to the type specified in the formal parameter list. If you encounter this error on code that compiled with an earlier version of Visual C++, see Technote: Improved Conformance to ANSI C++ for more information.

Possible cause

Example

class A
{
public:
   int i;
} a;
class B
{
public:
   operator int() { return i; }    // conversion operator
   int i;
} b;
void func1( int j = a ) {}  // error, can't convert a to int
void func2( int j = b ) {}  // OK

If the conversion operator in A is supplied, there is no error.