共用方式為


編譯器錯誤 C2762

'class' : 無效的運算式作為 'argument' 的樣板自變數

使用 /Za 時,編譯程式不會將整數轉換成指標。

下列範例會產生 C2762:

// C2762.cpp
// compile with: /Za
template<typename T, T *pT>
class X2 {};

void f2() {
   X2<int, 0> x21;   // C2762
   // try the following line instead
   // X2<int, static_cast<int *>(0)> x22;
}