Teilen über


Compilerfehler C3738

"calling_convention": Die Aufrufkonvention der expliziten Instanziierung muss mit der der Instanziierung der Vorlage übereinstimmen.

Bemerkungen

Es wird empfohlen, keine Aufrufkonvention für eine explizite Instanziierung anzugeben. Wenn sie jedoch übereinstimmen müssen, müssen die Aufrufkonventionen übereinstimmen.

Beispiel

Im folgenden Beispiel wird C3738 generiert.

// C3738.cpp
// compile with: /clr
// processor: x86
#include <stdio.h>
template< class T >
void f ( T arg ) {   // by default calling convention is __cdecl
   printf ( "f: %s\n", __FUNCSIG__ );
}

template
void __stdcall f< int > ( int arg );   // C3738
// try the following line instead
// void f< int > ( int arg );

int main () {
   f(1);
   f< int > ( 1 );
}