Share via


Derleyici Uyarısı (düzey 1) C4667

'function' : zorlamalı örneklemeyle eşleşen hiçbir işlev şablonu tanımlanmadı

Bildirilmemiş bir işlev şablonunun örneğini oluşturamazsınız.

Aşağıdaki örnek C4667'ye neden olur:

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

Bu uyarıyı önlemek için önce işlev şablonunu bildirin:

// 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 &);