Aracılığıyla paylaş


Derleyici Hatası C2894

şablonların 'C' bağlantısı olduğu bildirilemez

Açıklamalar

Bu hata, bir bloğun içinde tanımlanan bir extern "C" şablondan kaynaklanabilir.

Örnekler

Aşağıdaki örnek C2894 oluşturur:

// C2894.cpp
extern "C" {
   template<class T> class stack {};   // C2894 fail

   template<class T> void f(const T &aT) {}   // C2894
}

Aşağıdaki örnek C2894 oluşturur:

// C2894b.cpp
// compile with: /c
extern "C" template<class T> void f(const T &aT) {}   // C2894

template<class T> void f2(const T &aT) {}   // OK