Kompilatorvarning (nivå 1) C4667

"funktion" : ingen funktionsmall har definierats som matchar tvingad instansiering

Anmärkningar

Du kan inte instansiera en funktionsmall som inte har deklarerats.

Example

Följande exempel orsakar C4667:

// C4667a.cpp
// compile with: /LD /W1
template
void max(const int &, const int &); // C4667 expected

För att undvika den här varningen deklarerar du först funktionsmallen:

// C4667b.cpp
// compile with: /LD
// Declare the function template
template<typename T>
const T &max(const T &a, const T &b) {
   return (a > b) ? a : b;
}
// Then forcibly instantiate it with a desired type ... i.e. 'int'
//
template
const int &max(const int &, const int &);